PDA

View Full Version : Raytracing data!

snabeldragon
16-May-2007, 20:40
Hi.

Im about to do a raytrace test. I want to simulate a laser that scan through grass. I have found a polygon generator for trees and grass used with 3D studio, and Im want to see what the laser hit while sweep in a half circle in a plane.
What I need to do is trace the laserbeem and see what it hits, and give me the distance. And I need to do this on several million straws. I know it will take time and need a good computer (this is not an issue). I just want to know how this can be done using 3D-max script or can u send needed information to an extrenal program to do this. Also can I use the raytrace-function in 3DMax to get this information. Im not interested in reflections and refractions, only the acutal raytrace.

//snabeld.

Dee.cz
22-May-2007, 11:29
Optimal algo depends on type of rays, do you plan to cast
-1 ray?
-multiple parallel rays?
-multiple rays from one point?
-multilpe rays from random points, with random directions?
-how many rays?
-is scene static or does it change?

MfA
22-May-2007, 16:27
You can probably get 3ds max to write the Z-buffer, just render a frame and get it ... every pixel represents a ray, every Z value represents a distance (although you will need some math to get an actual distance out of it). Depending on the angle (and thus the average depth complexity) you might be better off with rasterization though, same results but could be faster.

snabeldragon
23-May-2007, 16:24
It is only one ray!. One laserbeam sweaping from 0 rad, to pi rad, (half circle).
The scene is dynamic and the ray is from one point. It will work as the eye of a robot calculating distance to object infront of you

Optimal algo depends on type of rays, do you plan to cast
-1 ray?
-multiple parallel rays?
-multiple rays from one point?
-multilpe rays from random points, with random directions?
-how many rays?
-is scene static or does it change?

Dee.cz
24-May-2007, 12:01
It is only one ray!. One laserbeam sweaping from 0 rad, to pi rad, (half circle).
The scene is dynamic and the ray is from one point. It will work as the eye of a robot calculating distance to object infront of you

MfA said it, rasterization could be optimal for dynamic scene. I can add only small observation: you need only 1 z value for 1 ray so rendering scene into 1x1 zbuffer seems optimal, however some cards are quite slow at rendering into 1x1 (fallback to sw rasterization?), so 16x16 is better choice.

snabeldragon
24-May-2007, 15:30
MfA said it, rasterization could be optimal for dynamic scene. I can add only small observation: you need only 1 z value for 1 ray so rendering scene into 1x1 zbuffer seems optimal, however some cards are quite slow at rendering into 1x1 (fallback to sw rasterization?), so 16x16 is better choice.

Thanx, But the speed is not an issue, since I might going to use a super computer.. :D But I will keep that in mind using 16x16.

MfA
29-May-2007, 17:01
It is only one ray!. One laserbeam sweaping from 0 rad, to pi rad, (half circle).
That's irrelevant.
The scene is dynamic and the ray is from one point. It will work as the eye of a robot calculating distance to object infront of you
That's very relevant, in fact it is so relevant your first post was a waste of time without it.

Forget about the ray for a moment, the much larger problem is getting a program to store your scene which will allows cheap dynamic updates ... if you have to write that yourself then you can safely forget about 3dsmax, writing a rudimentary single ray raytracer is the least of your worries. If not, what are you using that you expect you could run it on a super computer?