Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: modelling interference fringes

  1. #1
    Junior Member Newbie
    Join Date
    May 2005
    Location
    india
    Posts
    8

    modelling interference fringes

    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

  2. #2
    Advanced Member Frequent Contributor Ehsan Kamrani's Avatar
    Join Date
    May 2005
    Posts
    537

    Re: modelling interference fringes

    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-

  3. #3
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Dresden, Sachsen, Germany
    Posts
    203

    Re: modelling interference fringes

    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

    ...

  4. #4
    Junior Member Newbie
    Join Date
    May 2005
    Location
    india
    Posts
    8

    Re: modelling interference fringes

    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.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    659

    Re: modelling interference fringes

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •