Cast a ray manually?

Cast a ray manually?

Anonymous
Not applicable
480 Views
4 Replies
Message 1 of 5

Cast a ray manually?

Anonymous
Not applicable
I would like to specify an initial point and a direction vector and have maya give me back the coordinates of the first point the ray hits. It seems like this shouldn't be that hard to do, but I've been going crazy for a couple of weeks looking online and have found nothing of the sort.

Basically I want a point cloud model of the visible surface of some objects in a scene. I tried using the global variable aPointW but it ends up samples the objects uniformly on the surface; I'd like to sample them with uniform space between the rays cast from the camera.

Does this make sense? Is it possible?

Thanks!

David
0 Likes
481 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
what version of maya are you using? in the docs search for "intersectCmd" it is a devkit plugin that demonstrates the MFnMesh intersect methods using a light (which is the same as a vector) ...there is also a rayIntersect node from the net which I have compiled upto ver 8, code included.......

2008_DYmLk6rIZTmFJWnSlEgg.zip

0 Likes
Message 3 of 5

Anonymous
Not applicable
I'm using Maya 2008. The code you sent gives me 408 errors... I'm assuming because of the version difference? The errors are found in mstatus.h, mstring.h and a whole bunch more files like that.

I'll check out intersectCmd and let you know what I find.

Thanks,

David
0 Likes
Message 4 of 5

Anonymous
Not applicable
yeah...the version difference and also what are you compiling on?.......VS2005 is what maya is compiled on.....I use VS2003 (with no problems for the light duty code I create)...you may want to rebuild the project from scratch and just rely on the code and not the VS project stuff.....do you have the devkit plugin wizard installed?
0 Likes
Message 5 of 5

Anonymous
Not applicable
I ended up using the ideas from intersectCmd - thanks for the pointer!!
0 Likes