Results 1 to 2 of 2

Thread: how to draw two objects??

  1. #1
    Junior Member
    Join Date
    May 2005

    how to draw two objects??

    I need to draw a cube and a sphere inside the cube.
    the prupose is to move the two object at the same time. just as you are sitting at the center of your room, then you begin to rotate. all the objects in front of you start moving in the same manner.

    Code :

    Using this viewing transformation, i can draw a cube.

    Code :
    by applying this, i can draw a sphere which can be rotate by changing the angle.

    The problem is how to rotate two objects at the same time by changing the view point.

    Thanks for reading and thinking

    [ May 25, 2005: Message edited by: lavendersg ]

  2. #2
    Junior Member
    Join Date
    Jun 2004

    Re: how to draw two objects??

    Your lookat loads the viewing transformation onto the modelview matrix (or should if that's the active matrix)

    You should call lookat first.

    Then pushmatrix

    Then apply model the transformation.

    Anything you now draw will be positioned with those transformations with the moving object.

    Then you popmatrix.

    You will be back in world space ready to draw additional objects in different positions by repeating from the pushmatrix call above.

Similar Threads

  1. Draw many spheres
    By m_power_hax in forum OpenCL
    Replies: 3
    Last Post: 12-06-2010, 04:59 PM
  2. how to draw a polyhedron
    By netsolv in forum OpenGL ES
    Replies: 0
    Last Post: 01-26-2005, 01:54 PM

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