finding the camera up vector

   2584   4   1
User Avatar
Member
3 posts
Joined: July 2005
Offline
Does anyone know how to find out the current cameras up vector….? I would like to be able to pass it into pops so that i can do some clever stuff with sprites…
User Avatar
Member
276 posts
Joined: July 2005
Offline
Hi Milo,

In Houdini, the Camera's default up-vector is the +Y axis, so you can use the optransform expression to get the camera's transformation and apply it. A quick example:

(vector4(0,1,0,0)*optransform(“/obj/cam1”))

Hope that helps.

George.
User Avatar
Member
3 posts
Joined: July 2005
Offline
Thanks George,
that sounds as though it will do the job, just one last thing if the value returned is a vector is there an easy way to extract each of the elements individually .. i.e if i just want the x component

cheers

Miles
User Avatar
Member
276 posts
Joined: July 2005
Offline
You can dereference the components using the ‘[’ brackets… so for the x component in the above you can use:

(vector4(0,1,0,0)*optransform(“/obj/cam1”))

George.
User Avatar
Member
3 posts
Joined: July 2005
Offline
George thanks loads..
youve sorted my problem out down to a T … I'm amazed you can do this sort of stuff so easily in houdini…

well done..


Miles
  • Quick Links