Results 1 to 2 of 2

Thread: How to draw a 3D object at a fixed screen location

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2002
    Location
    San Mateo, California, USA
    Posts
    1

    How to draw a 3D object at a fixed screen location

    I am trying to draw a 3D object at the lower-right corner of the window. This object's 3D orientation should be the same as the scene's current orientation as the user do panning, rotating, zoomming, etc., and it should not change its size on the screen. How do I do this ?

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Birmingham, UK
    Posts
    7

    Re: How to draw a 3D object at a fixed screen location

    It's all to do with pushMatrix and popMatrix.
    You need to push the current matrix before you start drawing anything, if you draw your things you want to remain stationary with the view here and then push the matrix again before using the translate/rotate commands then drawing the things you want to pan etc in the main view it should work. You'll need to play with translation and rotations...

    eg:
    glPushMatrix();
    glPushMatrix();
    //tanslate/Rotate stuff for the little 'compass thing'
    glPopMatrix();
    //stuff to stay stationary
    glPushMatrix();
    //translate/Rotate stuff for main view
    //stuff to rotate in the main view
    glPopMatrix();
    glPopMatrix();

Similar Threads

  1. Getting screen location of 3D point.
    By c4ooo123 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-27-2017, 07:25 PM
  2. how to put a 3D object at fixed screen location ?
    By KC Cheng in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 03-15-2012, 10:30 PM
  3. Screen pixel to its location in global coordinate.
    By jxruan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-26-2001, 09:11 AM
  4. how to draw on the screen without cleaning others drawn object..?
    By tranckhanh in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-28-2001, 06:34 AM
  5. Location of object?
    By phenius in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-29-2001, 09:49 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