PDA

View Full Version : Coordinates of every visible point in a scene?


daviddoria
01-23-2008, 09:18 PM
I would like export a "point-cloud" type of file of every visible point in the scene. The result would be a text file of coordinates like this:
X1 Y1 Z1
X2 Y2 Z2
X3 Y3 Z3
etc.

Is this possible? I would like to basically shoot a "ray" in a specified direction from a specified point and measure the distance to the first object it hits.

Let me know if you can point me in some kind of direction!

Thanks!

David

daviddoria
01-24-2008, 02:03 PM
bump -

basically i want to do some manual ray tracing, or query mayas ray tracer to get its results in a raw format.

tbaypaul
01-24-2008, 04:19 PM
worldPoint is a global variable available from the sampler when the renderer is envoked.....there are several 3d textures and some shaders in the devkit that will serve as an example. You just name your attribute the same as maya's and the info is yours.....the samplerInfo node is just an example of a node that picks those variables up and allows you to use them in a shading network.

edit: oops, I got this mixed up with your post about the samplerInfo node....

GennadiyKorol
01-24-2008, 04:19 PM
Are you using API?

daviddoria
01-24-2008, 06:03 PM
tbaypaul: this may be exactly what I was looking for...
The question though is where do I put code that will run when the renderer is envoked? The problem I was having was I wrote a shader node that wrote the worldPoints out to a file, but it would only work for objects that had that shader attached (clearly). If I want worldPoints for ALL objects no matter which shader they are using, how do I do that? Ie. where is the "sampler" that has this global variable?

Thanks! Getting much closer!

David

BenBarker
01-25-2008, 10:50 PM
I think you could do this with a mental ray lightmap shader. The advantage is you could get all displaced geometry as well. This will be complicated if you aren't familiar with mental ray shaders.

You might want to look at tbaypaul's suggestions. You may have to make a pass where every object has the special shader attachment if you can't afford attaching it to the objects currently.

CGTalk Moderation
01-25-2008, 10:50 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.