Results 1 to 8 of 8

Thread: Changing a viewpoint of an object without cam move

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    4

    Changing a viewpoint of an object without cam move

    Hello all,

    I am quite new to opengl programming. I have one scene in which I render a cube at the right bottom side. Now I want to move the cube to the center without changing my view. I know it's possible to change the camera view and also the position of the object. But is it also possible to put somehow the object(cube,rectangle,sphere) from one place to another without changing the perspective?

    Here is one example explaining my problem maybe in a more detailed way:

    If I am sitting in a room on the right bottom side is a paper bin. From this position I am able to look inside the bin. Now I want to move this bin to the center, but keep the perspective that I still can look a little bit inside the bin.

    Is there any possibility to do this with openGL?

    I am thankfull for a little help.

    heavenssake007

  2. #2
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Changing a viewpoint of an object without cam move

    ...without changing the perspective?
    What do you mean here? I don't understand your problem, are you looking for something like glTranslate?

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    4

    Re: Changing a viewpoint of an object without cam move

    Hello,

    glTranslate is moving the object completely and the perspective will be changed. Correct me if i am wrong.
    So what i am looking for is a way to move the object, but don't change the angle you watch to the object. This is what i mean by keeping the perspective.

  4. #4
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Changing a viewpoint of an object without cam move

    Pardon my ignorance but I still can't visualizing what you need to do... perhaps, some pics would help?
    Re-reading your illustration with the paper bin, it comes to my mind this thing: Do you want something like billboard, something to keep the object facing a particular target like the camera? Sorry if I am thousand miles from your idea, I am sure a drawing of your idea would help!

  5. #5
    Senior Member Regular Contributor
    Join Date
    Oct 2009
    Posts
    132

    Re: Changing a viewpoint of an object without cam move

    I think heavenssake07 means the image of the bin stays exactly the same as it was when rendered in the corner, it is just shifted in 2D screen space from it's corner to the center; As if done after the 3d rendering is finished.

    right?

  6. #6
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    4

    Re: Changing a viewpoint of an object without cam move

    Yes,
    this is exactly what I mean.
    So is there a possibility to do this?

  7. #7
    Senior Member Regular Contributor
    Join Date
    Oct 2009
    Posts
    132

    Re: Changing a viewpoint of an object without cam move

    It is possible

    One method is done perhaps by rendering your cube/bin as it is in the corner to a Frame Buffer Object or render it to screen and copy it out to a texture using glCopyTexSubImage (i think this is the right function).

    Then render the texture you created to a screen aligned polygon, shifting either the texture coordinates or the actual polygon to align your image to the centre.

  8. #8
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    4

    Re: Changing a viewpoint of an object without cam move

    Thanks for your answer I will try this and post my result.

Similar Threads

  1. Moving a light when changing the viewpoint
    By Lefteris in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-18-2010, 04:18 PM
  2. Replies: 4
    Last Post: 08-30-2006, 09:30 PM
  3. changing viewpoint
    By jenny in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-15-2002, 08:36 PM
  4. Rotating viewpoint around a 3d object
    By JtheKing in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-25-2001, 08:56 PM
  5. Replies: 1
    Last Post: 03-11-2001, 01:55 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