PDA

View Full Version : modelling interference fringes

06-03-2005, 09:16 PM
i was modelling the interference fringes of an experiment. the variation of intensity of the pattern will depend on the cosine of the phase difference. what capabilities are there in opengl so that i can make the pattern look realistic

Ehsan Kamrani
06-04-2005, 02:56 AM
In OpenGL, you can use from three transformations:Translation, Rotation ,Scaling. You should use from these transformations to move fingers. Computing the mathematics is on to you--OpenGL dosn't provide some functions to compute the mathematics.
-Ehsan-

06-06-2005, 06:18 AM
Do you want to show the data in 2d or in 3d?

The math is up to you, opengl does provide the graphical primitives (points, lines, polygons, ..) to present your data

...

06-07-2005, 09:21 PM
i want it in 2D. the math is not the problem. i want to know how the intensity variation can be modelled by suitable shading. the intensity varies as i = 2I(1+cos(theta)). the shading should model this equation. i have seen function glShadeModel() It takes GL_SMOOTH as one of its parameters.But the intensity variation doesnt correspond to the above equation. that is my problem.

RigidBody
06-08-2005, 01:07 AM
i think you could use the ARB_texture_env_dot3 extension. it combines two textures using a dot product on a per-pixel basis.

as we know, if we have two unit vectors a and b with an angle theta between them,

cos(theta) = a dot b.

so you could just construct a texture A with (0,0,1) normals and a texture B with (0, 0, cos(theta)).

be aware that an rgb value of (0,0,0) corresponds to a normal (0,0,-1), as rgb=(0,0,255) corresponds to a normal (0,0,1)