Jump to content


Orient instanced geo thru the copy SOP


  • Please log in to reply
8 replies to this topic

#1 etudenc

etudenc

    Peon

  • Members
  • Pip
  • 25 posts
  • Joined: 29-September 10
  • Location:New York
  • Name:Phil Cole

Posted 13 June 2012 - 08:08 PM

Hi all,

I've put together a pretty simple demo of what I'm trying to do. In the picture you'll see a top-down view of a wireframe grid and a bunch of instanced grids that were created using a popnet to copy SOP from the wireframe grid as it rotated around a pivot.

In a nutshell I want the instanced grids to inherit the master grid's orientation. Is there a way to do this *other* than sorting the points and using $TX2-$TX/$TY2-$TY/$TZ2-$TZ in a point SOP to set the normals? In this example I know it would work, but if the number of emitting faces is changing every frame then the points would be less orderly and not line up.

As always, any suggestions would be greatly appreciated!

Thanks!

Attached Thumbnails

  • copiedGeo_missing_orientation.jpg

Attached Files


Edited by etudenc, 13 June 2012 - 08:10 PM.


#2 bloomendale

bloomendale

    Initiate

  • Members
  • PipPip
  • 176 posts
  • Joined: 26-December 11
  • Name:- -

Posted 13 June 2012 - 10:32 PM

View Postetudenc, on 13 June 2012 - 08:08 PM, said:

Hi all,

I've put together a pretty simple demo of what I'm trying to do. In the picture you'll see a top-down view of a wireframe grid and a bunch of instanced grids that were created using a popnet to copy SOP from the wireframe grid as it rotated around a pivot.

In a nutshell I want the instanced grids to inherit the master grid's orientation. Is there a way to do this *other* than sorting the points and using $TX2-$TX/$TY2-$TY/$TZ2-$TZ in a point SOP to set the normals? In this example I know it would work, but if the number of emitting faces is changing every frame then the points would be less orderly and not line up.

As always, any suggestions would be greatly appreciated!

Thanks!

Hi.
Do you mean copy, not instance?
Possible solution:

Attached Files



#3 sadhu

sadhu

    Initiate

  • Members
  • PipPip
  • 172 posts
  • Joined: 09-July 09
  • Location:Mumbai, India
  • Name:Sandeep Doshi

Posted 13 June 2012 - 10:52 PM

One more solution..
:)

Attached Files


Edited by sadhu, 13 June 2012 - 11:01 PM.


#4 etudenc

etudenc

    Peon

  • Members
  • Pip
  • 25 posts
  • Joined: 29-September 10
  • Location:New York
  • Name:Phil Cole

Posted 14 June 2012 - 07:24 AM

Thanks so much for the help, guys. I realize my example was too simple so I've made some adjustments.

This time the master grid is being moved along a path so I don't think I can query actual rotation values coming from the xform. I still want the copied geo to get its orientation from the face it's essentially being copied from.

Is there some way I could set the normal of a point based on where it was in the previous frame? Or is it possible to transfer the normal of the "emitting" primitive to the point inside the forEach?

Hope that's clearer. What I'm actually trying to do is lay down tire tracks from tires that were translated/rotated in Maya. I'm grouping faces on any tire tread that enters into the boundary of a cube, finding their centers and emitting particles to copy to, like what you see in the attached example.

Thanks again!

Attached Thumbnails

  • copiedGeo_missing_orientation.jpg

Attached Files



#5 Rudinie

Rudinie

    Initiate

  • Members
  • PipPip
  • 105 posts
  • Joined: 24-April 08
  • Location:Netherlands
  • Name:rudi Nieuwenhuis

Posted 15 June 2012 - 02:12 PM

Something like this?

Attached Files



#6 etudenc

etudenc

    Peon

  • Members
  • Pip
  • 25 posts
  • Joined: 29-September 10
  • Location:New York
  • Name:Phil Cole

Posted 16 June 2012 - 08:13 AM

View PostRudinie, on 15 June 2012 - 02:12 PM, said:

Something like this?
Thanks, yeah that's much closer. I tried a different solution by subtracting point 0's position from point 1's position on each primitive inside the forEach, then setting an "up" vector based on the result. An attrCopy SOP copies that normal back to the final fused point of each primitive that gets sent to the POP SOP (way easier to see in the file than to explain in words). For my purposes this seems to work better for cases where the number of "emitting" primitives changes from frame to frame.

Thanks for looking and for all the help, folks.

Attached Files



#7 Rudinie

Rudinie

    Initiate

  • Members
  • PipPip
  • 105 posts
  • Joined: 24-April 08
  • Location:Netherlands
  • Name:rudi Nieuwenhuis

Posted 18 June 2012 - 12:53 AM

How about not using particles at all but just using a sopsolver, like in this example.

Attached Files



#8 etudenc

etudenc

    Peon

  • Members
  • Pip
  • 25 posts
  • Joined: 29-September 10
  • Location:New York
  • Name:Phil Cole

Posted 19 June 2012 - 12:43 PM

View PostRudinie, on 18 June 2012 - 12:53 AM, said:

How about not using particles at all but just using a sopsolver, like in this example.
Thanks for uploading the example. Haven't used the sop solver at all so between your file and the Peter Quint videos I should be better informed very soon. Thanks again!

#9 anim

anim

    Houdini Master

  • Members
  • PipPipPipPip
  • 911 posts
  • Joined: 23-August 07
  • Location:Slovakia, Bratislava
  • Name:Tomas Slancik

Posted 08 July 2012 - 04:11 PM

View Postetudenc, on 14 June 2012 - 07:24 AM, said:

...I still want the copied geo to get its orientation from the face it's essentially being copied from. ...

it there a reason why you don't precompute N and up values on your source mesh? then it will be transformed automatically with object merge
or
if you don't want to do that you can do something like this to get orientations of faces from arbitrary poly geo
also better way to detect center points of faces may be to use divide sop instead of forEach

Attached Files


Tomas Slancik
Generalist
Slovakia




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users