Jump to content


How to get world coordinates at the geometry level?


  • Please log in to reply
6 replies to this topic

#1 magneto

magneto

    Grand Master

  • Members
  • PipPipPipPipPip
  • 2,011 posts
  • Joined: 04-October 11
  • Location:Canada
  • Name:Ryan K

Posted 10 April 2012 - 01:39 AM

I have a Geometry object and a Null object. I want to get the world coordinate position of the Null object that will always be at the position of the Null no matter the transformation of the Geometry object.

Currently I use origin expression but I get the position that's offset by the transformation of the Geometry object.

Any ideas?


Thanks :)

#2 sanostol

sanostol

    Houdini Master

  • Members
  • PipPipPipPip
  • 743 posts
  • Joined: 09-January 06
  • Location:Munich, Germany
  • Name:Martin Matzeder

Posted 10 April 2012 - 02:40 AM

in a vopnetwork, use the `optransform("path to object")` it gives you a matrix, that you can use to multiply the pointpostion to get it in global space
another thing would be (easier) use a object merge SOP and merge in the point of the null, and set it to transform into this object
this gives you the point in global space
Martin Matzeder - Booyabase

#3 magneto

magneto

    Grand Master

  • Members
  • PipPipPipPipPip
  • 2,011 posts
  • Joined: 04-October 11
  • Location:Canada
  • Name:Ryan K

Posted 10 April 2012 - 03:11 AM

Thanks sanostol. Do you mean using optransform in VEX? How can I use it in VOPs since you said in a vopnetwork?

I was gonna try the Object Merge, but it can be any object, i.e. very high res mesh, so that's why I didn't want to merge it just for this.

#4 graham

graham

    Houdini Master

  • Moderator
  • 778 posts
  • Joined: 13-September 06
  • Location:Santa Monica, CA
  • Name:Graham Thompson

Posted 10 April 2012 - 06:39 AM

You'll need to multiply by the transform of the null and the invert transform of your geometry object. It's definitely easy enough to do in Python so that might be a better bet. You can do this with 2 of the operators I posted in your other thread connected together.

http://forums.odforc...__0
I write python and break things.

#5 magneto

magneto

    Grand Master

  • Members
  • PipPipPipPipPip
  • 2,011 posts
  • Joined: 04-October 11
  • Location:Canada
  • Name:Ryan K

Posted 10 April 2012 - 06:48 AM

Thanks Graham, in VEX/VOPs how would you get the transform matrix of an object? I looked at VOPs just to see but didn't see anything matrix related that has an object/operator path.

I will give your operator a try for this problem as well. origin expression also works, just had to figure out the path issue there :)

#6 tjeeds

tjeeds

    Initiate

  • Members
  • PipPip
  • 142 posts
  • Joined: 12-July 07
  • Location:Los Angeles
  • Name:Jesse Erickson

Posted 10 April 2012 - 08:25 AM

The help has two listings for optransform, one is VEX and one is an expression. Occasionally you'll run into VEX functions that aren't mapped into VOPS, this appears to be one of them. You can just pop it into an inline code node to use it in VOPS.

Attached Files



#7 magneto

magneto

    Grand Master

  • Members
  • PipPipPipPipPip
  • 2,011 posts
  • Joined: 04-October 11
  • Location:Canada
  • Name:Ryan K

Posted 10 April 2012 - 08:38 AM

Thanks tjeeds, very helpful. I think that also happens when you go from VOPs into VEX, like there is no sign function in VEX.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users