POP: Upvector, Instances and copy (Bug?)

   4160   3   1
User Avatar
Member
85 posts
Joined: July 2005
Offline
Please find attached the hip file.
I have a POPnet with some instances.
When the particles hit the ground I want to force the upvector to be equal to the normal of the grid. (By importing the attr N from the grid to the POPnet)
My POP instance gives me what I want but when I render, it is corrupted, I tried with the Copy SOP and I have the same “bug”. If I change the upvector POP to use a fixed axis for the orientation, the funny bit goes off.
The funny bit is: Some copies of the geo will be missing, scaled and not oriented properly.
Before crying BUG! I think there is an explanation or a bad setting.
Any help will be very appreciated.
Cheers

Attachments:
upvector.hip (509.7 KB)
upvector.rar (22.6 KB)

User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Basic mistake but it is forgivable.

Short Answer:
Insert a Point SOP between your POP Network SOP and the right input to the Copy and set the option “No Normal” in the Point SOP.
This will destroy the normals on your particles causing the problem.

Long Answer:
You need to know how Mantra and the Copy SOP deal with the various attributes that align geometry to points. I will refer to the Copy SOP but it also applies to Mantra implicitly.

The Copy SOP uses several attributes to automatically orient geometry to template points if these attributes exist on the template points. Let's just look at N, v and up for now.

N or v is used to aim the copies down their Z-axis. If only v or N is present, then it is obvious which one is used since there is only one. If both N and v are present, the N normals are used to orient the copies.

up is used to aim the Y-axis of your geometry.
The x-axis is computed on-the-fly automatically by computing a cross product between N/v and up.

You had all three attributes defined: N, v and up. The Copy SOP was using N to orient the copies. Since you used N to generate the Up Vector, the cross between N and Up was either giving you 0 or some infinitesimally small value that was causing the most bizarre scaling of the geometry.
By removing N from the template points, the orientation of the pieces is now predicated on v velocity and up as the POP network was doing.
POPs ignore surface normals for orientation.

Many advanced users use this behaviour to their advantage.

The Copy SOPs use of template attributes is explained well on that SOPs help card and I believe the Copy SOP has the second most number of example files (with the Point SOP having the most and rightfully so ).


-jeff
There's at least one school like the old school!
User Avatar
Member
1631 posts
Joined: July 2005
Offline
In addition to Jeff's usual wonderful explanation, please check out this thread [sidefx.com] too.

Cheers!
steven

PS: It should be a sticky!
User Avatar
Member
85 posts
Joined: July 2005
Offline
Thanks both of you.
I am impressed that I didnt find Jim's explaination from the lastest given thread.
  • Quick Links