Hello,
We can not find in the HDK toolkit headers how to extract camera matrix (or camera position) inside a VRAY procedural. As a basic method it is possible to pass camera position from the asset to the procedural, but how is it possible to get (world-space) camera data inside the procedural code? There is a friend class VRAY_Scene, but we haven't found anything else. It is possible to query objects but it didnt work for a camera geo, and we haven't find a Mantra property for the camera position to import. It shall be possible to implement this because the sprite procedural does something similar that we are interested in.
Thanks.
luis.
Getting camera data inside a VRAY procedural
3314 2 1- luismiguel
- Member
- 3 posts
- Joined: March 2009
- Offline
- wolfwood
- Member
- 4271 posts
- Joined: July 2005
- Offline
During rendering the camera is at the origin (identity) and the scene is placed relative to it.
So fetching any transform will be relative to the camera. If you need the scene's world space (ie in Houdini) I think you'll need to plop a null with its save transforms to IFD turned on and then query that.
That said…
My first instinct would be to use VRAY_Procedural::import()
fpreal world
int status = import(“space:world”,world,16);
However it appears “space:world” isn't defined.
Which is kind of annoying since “space:world” works in some places but not others. It doesn't show up if you do a ‘ray_show globals’ but it *is* available in vm_saveopts and in shaders. So I dunno.
So fetching any transform will be relative to the camera. If you need the scene's world space (ie in Houdini) I think you'll need to plop a null with its save transforms to IFD turned on and then query that.
That said…
My first instinct would be to use VRAY_Procedural::import()
fpreal world
int status = import(“space:world”,world,16);
However it appears “space:world” isn't defined.
Which is kind of annoying since “space:world” works in some places but not others. It doesn't show up if you do a ‘ray_show globals’ but it *is* available in vm_saveopts and in shaders. So I dunno.
if(coffees<2,round(float),float)
- asterX
- Member
- 1 posts
- Joined:
- Offline
-
- Quick Links