channel reference for normal of point

   4533   4   1
User Avatar
Member
6 posts
Joined: Aug. 2008
Offline
I am trying to access the values of the normals of one of the points of a primitive. The primitive has four points each with a normal. A drag and drop from the point sop (which has the normal attribute) gives the reference:

ch(“/obj/track_atoms/point1/nx”)
User Avatar
Member
6 posts
Joined: Aug. 2008
Offline
Mmm… it seems the problem is that there is a difference between the values displayed in the point sop parameter fields and the values displayed in the spreadsheet. If I use the spreadsheet (to view the point sops parameters) I see non-zero values for the normal components, but in the point sop “add normals” fields (which have the variables $NX, etc) the value they display is zero for all components.

I guess I don't really understand why they are different??

thanks,
Richard.
User Avatar
Member
6 posts
Joined: Aug. 2008
Offline
Seem to be talking to myself Anyway I seem to have sorted it by using the normal() expression rather than a channel reference - although I would still like to know why the spreadsheet is reporting different values to the point sop (and how to access array elements with a channel reference).

cheers,
Richard.
User Avatar
Member
1906 posts
Joined: Nov. 2006
Offline
You can't actually reference attribute values using a channel reference. What you need to use is the point() expression.

For example, to get the Y value of point 3's normal you could do this, assuming point1 is creating normals.

point(“/obj/track_atoms/point1”, 3, “N”, 1)

The fact that it is showing different values in the point sop parm fields as opposed to the spreadsheet is that since you have multiple points it can't accurately display all the attribute values in the single parameters at once.

The normal() expression is actually outputting the the primitive normal at the specified uv value.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
6 posts
Joined: Aug. 2008
Offline
Ah - OK - i get it - thanks for that.
Richard.
  • Quick Links