## 3d Surface illumination + shadow using Opengl or other ray tracer?

### 3d Surface illumination + shadow using Opengl or other ray tracer?

3d Surface illumination + shadow using Opengl or other ray tracer?

Hi there

_Intro_

I'm working on a program to measure the sound reaching a surface
(i'll call this the receiver surface) from point sources. I've
modeled it similar to rays of light; inverse square of the distance
from the source & shadows created by obscuring surfaces.

What I understand of OpenGL, it could do this for me. Is possible to
access OpenGL directly in Matlab, esp as I have obscuring surfaces
blocking the path of light.

Unfortunately I'm not sure what I'm looking for, all the things I've
found googling Matlab and OpenGL mostly as to do with Matlab's
inbuilt graphing functions for 3d objects (like the Matlab logo)

_My current method _

Essentially i've traced a ray to from source to grid of receivers

The way I've done it is to create a meshgrid which represents the
receiver surface, then create a vector from the meshgrid point, to
each source then checks for intersection with each obscuring surface,
it accumulates level using an inverse square -20*log10(distance) for
each visible point source. Finally plotting the result as a surf.

All my surface data is stored as 3d polygons in structured arrays.
i.e.
surface(i).x = [0 0 1 1 0];
surface(i).y = [0 1 1 0 0];
surface(i).z = [0 0 0 0 0];
surface
plot3(surface(i).x,surface(i).y,surface(i).z);

_Conclusion_

It seems a bit cumbersome, as I have several embedded loops, having
to check each vector for intersection with an obscuring surface

_Question_

Is it possible to use the OpenGL (or another render/ray trace)
libraries in matlab to do this without the need for a meshgrid? By
creating the a light source that illuminates a surface then measuring
the total illumination on receiver plane.

Currently I'm only interested in the level and if another object is
obscuring and causing a shadow, but later features may include the
ability know which source the ray has come from and lit my surface.

Any ideas or suggestion very much appreciated.

Regards
Jim

Thanks for your Interest, Sir Can you tell me can i use *.mdl to
design robot, actually i itself don't know through which software i can
build up *.mdl file because in some program on nehe.gamedev.net they
are using *.mdl file and i think i am comfartable in this format
because nehe providing some source code which is working on *.mdl file
format. sir according to your point of view which software is better
for my robot wether *.mdl or you adviced, if you favour 3dmax or
milkshape3d then can you please provide me some source code to plug-in
these object in the openGL,i am waiting for you reply.
bye..... thank you