Results 1 to 3 of 3

Thread: projecting from fixed size image on plane

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    17

    projecting from fixed size image on plane

    I have a projection point(camera location), a fov, a focal length, a image plane and the objects in 3d space.

    I have been given the image on the image plane and want to backproject it into 3d space. The texture will only cover a single 2d quad at a given distance away from the projection point.

    Summary: Projection from a image plane onto another plane further away.

    I'm trying to do this with projective texturing, does this make sense?
    Does it make sense to project each vertex of the image using gluUnProject?

    I have a feeling I cannot specify the image plane, because with opengl, i have the camera, project matrix, modelview matrix and quad that i'm projecting onto... but i don't have a physical image plane from whence my image comes from. This is the source of my confusion.

    Joe.
    Joe.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2001
    Location
    Italy
    Posts
    625

    Re: projecting from fixed size image on plane

    Well, I'm not sure I'm getting this right.

    Originally posted by mordrax:
    The texture will only cover a single 2d quad at a given distance away from the projection point.
    Err... so you're not meaning you want to 'project' it as a projector would?
    Originally posted by mordrax:
    Summary: Projection from a image plane onto another plane further away.
    I am (mis?)understanding this is "large enough" to cover the whole viewport.
    It doesn't matter, projective texturing will cut it even with arbitrary geometry.
    Originally posted by mordrax:
    I'm trying to do this with projective texturing, does this make sense?
    Yes, altough it's probably overkill for the purpose.
    Originally posted by mordrax:
    Does it make sense to project each vertex of the image using gluUnProject?
    If you mean to project the vertex of the plane "being textured" to check where it falls of and then feedback the texcoords accordingly... well, maybe it works but I believe it would be sub-optimal.
    You possibly won't see a performance difference for now, but I'll go straight for projective texturing, which is much more general.
    Originally posted by mordrax:
    I have a feeling I cannot specify the image plane, because with opengl, i have the camera, project matrix, modelview matrix and quad that i'm projecting onto... but i don't have a physical image plane from whence my image comes from. This is the source of my confusion.
    You are partially right, the trick is made using a texture matrix, loading up... (take this with some salt) a lookup.
    So, for example, if projector is at P looking at L you put in the matrix this lookAt transformation and then use it as a TexGen.
    Take my words with some salt, I'm not really sure how projective texturing works in the fixed function pipes and some years ago I made it work thuru a fragment program.
    I'm quite sure you can easily do it from a vertex program as well, I don't remember why I didn't do it.

  3. #3

Similar Threads

  1. Projecting a plane onto a cylinder
    By amarnd in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-15-2009, 10:29 PM
  2. Replies: 10
    Last Post: 01-04-2007, 12:02 AM
  3. how to have a fixed size disk?
    By jyoung77 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-25-2005, 06:55 PM
  4. Replies: 0
    Last Post: 02-19-2004, 05:09 AM
  5. Fixed size (can't find a better name...)
    By Eric in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 01-11-2002, 12:11 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