# where/how to find information about attributes ?

hello,

i am having hard time to find some details on syntax and keywords used for attributes.

I know that points position is accesses via P attribute and and each coordinate is reachable using tx, ty and tz. Normal are N etc… I found this information when viewing some tutorials but i can’t find it reading the documentation.

Now i need to access vertex tangent coordinates. I figured this is the T attribute and has 4 elements in it… but i don’t know what they are called

thanks

For the record : i have a circle SOP from which i want to use vertex tangents to orient an instanced shape at those points.

This is how i tried to grab those information but when i ask for P and T in the SOPtoCHOP it throws me the error "unknown attribute “T” ". In the AttributeCreate SOP i ticked “compute tangents”

The list of attributes can be found here:

derivative.ca/wiki099/index … Attributes

Using a SOP to DAT I can see the tangents (change the extract type to vertices), getting that out of a CHOP is a little less straightforward.

Thanks Matthew.

I saw this list, i think i don’t fully understand it. Anyway, there is no Tangent mentioned in this list.

In the Attribute create on my network i can see vertex attributes like N and T, isn’t it possible to access them in the SOPtoCHOP ?

Anyway, i tried using the SOPtoDAT but all tangents are the same so i am not able to rotate the instanced objects as i expected
grid_shape_instance.tox (3.15 KB)

The Sopto CHOP specifically works with the points from a SOP, not the verts - so while you can get point attributes, vertex attributes are harder to extract.

derivative.ca/wiki099/index. … OP_to_CHOP

Out of the box you have to think about working with point attributes with this CHOP, which ends up being this sub-set:
derivative.ca/wiki099/index. … Attributes

Here’s an example of how that list relates to extracting point information with the sopto CHOP based on the list above:
base_sopto.tox (854 Bytes)

The bigger challenge to solve here is that Tangents are vertex attribute, not a point attribute - which is why you can’t extract them with a sopto CHOP.

Idz has a great descrition of the difference between points and verts here:

viewtopic.php?f=27&t=10477&hilit=points+vs+verts

Yeah i figured out there was two different data like point and vertex. Thanks for the clear explanation that helps a lot.

So do you think my approach in the attached .tox before is right ?

In the end, i can’t be able to rotate the instanced object so they are oriented towards the center of the circle. I must be something wrong here…

thanks a lot

I’d use the rotate to vector parameters and reuse your point position here. You’ll also need to add in channels to provide an up vector, but then you should end up with a set of instances that all face inward.

base_rotate_to_vector.tox (1.08 KB)

nice thanks !

two more questions :

• I don’t understand how the tx, ty and tz are capable of orienting the shape…

• Despite i’ve read the doc, i don’t understand the purpose of up vector

To really understand part of what’s happening here it’s important to consider that TouchDesigner is doing lots of openGL work behind the scenes - the exposed parameters in many operators (some Comps, and most TOPS) are passed through to GLSL operations that happen on the GPU. The more you learn about GLSL the less ambiguous some of the language in the TouchDesigner network editor will become - that’s not to say that you have to learn GL, only that some real clarity about what’s happening stems from knowing a little about GL as a language.

I don’t know for sure, but I’d guess that many of the rotation operations happening on geometry components are actually using a rotation matrix - which is pretty common in GL. It’s not uncommon in Touch to use the Normal from a set of points as the rotate to vector. This makes good sense since:

en.wikipedia.org/wiki/Normal_(geometry

Thinking of our normal as a direction that we need to be perpendicular to means we can do a bit of matrix math to make our rotation happen correctly. In this example we don’t use normals as our rotate to vector, instead we use our existing point position - depending on the orientation or our instanced geometry we should be able to end up with something that’s perpendicular to our point.

An Example of a rotation Matrix in GL

Matrix Math Explained

Up Vectors

An up vector helps ensure that you’re explicit about what direction is considered up. That seems non-sensicle based on our experience with gravity, but if you imagine a situation without gravity how you define “up” makes a difference to your orientation. Some environments think of positive Y as being the up direction, others conceive of positive Z as the up, others negative Z. Consider the geometry viewport in Touch. The other issue you can sometimes encounter is that the the rotate to vector is coplanar with the point position defining rotation becomes ambiguous, and no transformations will be performed on that instance. In this example providing an up vector ensures that these bits are explicitly defined.

en.wikipedia.org/wiki/Relative_direction

xboxforums.create.msdn.com/forums/t/5248.aspx