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

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

Post by james robe » Mon, 12 Mar 2007 12:19:22

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

Hi there


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
testing for shadowing.

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.
surface(i).x = [0 0 1 1 0];
surface(i).y = [0 1 1 0 0];
surface(i).z = [0 0 0 0 0];


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


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.


1. movement of 3D object on 3D surface in openGl

2. movement of 3D object on 3D surface in openGl

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

3. Phos ray tracer and 3d real-time engine

4. Ray*: ray tracer spin-offs

5. Ray tracing: Ray interceptions with surface

6. global illumination and colour bleeding in Maya/mental ray

7. phong illumination model in ray tracing context

8. [PATCH 2/3] tracing/ftrace: make nop tracer using tracer flags

9. reflections, shadows and indirect illumination

10. How can I keep a surface fixed plot in 3D Parametric Surface

11. Realistic Illumination, IDL & OpenGL

12. ray tracer for higher qualitly rendering of models

13. ray tracer max intersection parameter,

14. df3 format for POV ray tracer?

15. Making my own Ray Tracer