Results 1 to 2 of 2

Thread: space ship

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2016
    Posts
    10

    Question space ship

    well I am trying to draw a space ship and have it move up and rotate around its origin and also have it follow its own nose. Basically I want it to move like in asteroids. I have almost figured out this problem. So far I moved the coordinate axis 5 units to the right and then rotates the ship and then moves the ship up. My problem is that now I want the ship to rotate around its own center or origin.

    glPushMatrix();

    glTranslatef(5.0f, 0.0f, 0.0f);

    glRotatef(angle, 0.0f, 0.0f, 1.0f);

    glTranslatef(0.0f, up, 0.0f);

    draw_ship();

    glPopMatrix();

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,214
    I guess this could help you to understand model-view transformations.

Similar Threads

  1. moving space ship
    By pbivens in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 03-12-2018, 06:21 AM
  2. Computing radiance in world space, object space or view space?
    By shapeare in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-25-2013, 06:22 PM
  3. Second Life/The Ship
    By in forum OpenGL: User Software
    Replies: 4
    Last Post: 10-09-2006, 09:56 AM
  4. Ship Movement
    By Sogekihei in forum OpenGL: General
    Replies: 1
    Last Post: 04-01-2005, 07:14 PM
  5. How to create space-ship
    By abhiboy007 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-18-2001, 07:43 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