Results 1 to 2 of 2

Thread: Projected Textures

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Austin,TX,USA
    Posts
    12

    Projected Textures

    Anybody done projected textures in opengl? I'd like to give it a shot, but don't know where to start.

    Any urls that might help?

    -Jon

  2. #2
    Senior Member Frequent Contributor imported_cass's Avatar
    Join Date
    Feb 2000
    Location
    Austin, TX, USA
    Posts
    913

    Re: Projected Textures

    Jon,

    I recently wrote a very simple demo program whose sole purpose is to illustrate projective texturing. I think the code is pretty easy to follow, so I put it out on my web page in case you'd like to look at it.
    http://www.r3.nu/~cass/projspot.zip

    It has a Makefile for linux and a project file for MSVC++.

    The thing about projective texturing is that you can think of it as just another camera in the scene. You use GL_EYE_LINEAR texgen - and I'll mention that it's important when you specifiy your texgen eye planes because they're transformed by the inverse of the current modelview matrix. (This took me a while to figure out, but it's the kind of thing you never forget after wasting hours trying to make your program behave correctly. ) Anyway, what that means is that you'll probably want the VIEW in the modelview matrix when you specify your eye planes for texgen. That way coordinates that texgen produces are in "world" space. You can then put your view, projection, and scale and bias transforms into the texture matrix and voila. That's it. The reason you need a scale and bias is that the standard projection functions (like gluPerspective) move coordinates that are in the view frustum in eye space into the [-1,1] range. Since texture coordinates are in the range [0,1], you need a final scale by half and bias by half.

    I think the code that I linked to should complement this post pretty well. If you are comfortable with how transforms work and how to position the camera and stuff, projective texturing is pretty simple to get the hang of.

    Good luck -
    Cass


    [This message has been edited by cass (edited 04-09-2000).]
    Cass Everitt -- cass@xyzw.us

Similar Threads

  1. Orthographic projected textures
    By soconne in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-02-2005, 06:06 AM
  2. Lighting with projected textures?
    By mondprop in forum OpenGL: GLSL
    Replies: 4
    Last Post: 09-22-2004, 07:18 AM
  3. Projected Textures (dumb question about)
    By Robbo in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 06-25-2002, 08:56 AM
  4. Projected Textures and Fog
    By jmt in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-26-2001, 11:01 PM
  5. Projected textures
    By santyhamer in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 09-15-2000, 09:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean