Results 1 to 3 of 3

Thread: 2 sets of coordinates

  1. #1

    2 sets of coordinates

    How do I create another set of coordinates so I have 2? I want to use the second one so I can move that around in my project.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: 2 sets of coordinates

    Hi !

    You can save the current transformation and later restore it with the glPush/glPop/Matrix() functions.

    And if that's not enough you can reload the transformation matrix at any time you want.

    Mikael

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: 2 sets of coordinates

    How about this

    // Coord system 1
    int world_x, world_y, world_z;
    int world_rotate_x,world_rotate_y,world_rotate_z;

    // Coord system 2
    int object_x, object_y, object_z;
    int object_rotate_x,object_rotate_y,object_rotate_z;

    glTranslatef(world_x, world_y, world_z);
    glRotatef(world_rotate_x, 1.0, 0.0, 0.0);
    glRotatef(world_rotate_y, 0.0, 1.0, 0.0);
    glRotatef(world_rotate_z, 0.0, 0.0, 1.0);


    glPushMatrix();
    glTranslatef(object_x, object_y, object_z);
    glRotatef(object_rotate_x, 1.0, 0.0, 0.0);
    glRotatef(object_rotate_y, 0.0, 1.0, 0.0);
    glRotatef(object_rotate_z, 0.0, 0.0, 1.0);
    Draw_object();
    glPopMatrix();

    Originally posted by ltrain_riders:
    How do I create another set of coordinates so I have 2? I want to use the second one so I can move that around in my project.

Similar Threads

  1. two sets of data
    By macsam in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-21-2019, 01:16 PM
  2. Disturbed Descriptor Sets
    By Twanks123 in forum Vulkan
    Replies: 1
    Last Post: 05-27-2016, 01:34 PM
  3. finding intersection of two sets
    By shahsaurabh1990 in forum OpenCL
    Replies: 0
    Last Post: 01-27-2013, 10:15 PM
  4. Updating uniforms between sets of primitives
    By GreenOwl in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-24-2012, 04:54 PM
  5. A few questions about <input> and sets
    By parmus in forum COLLADA
    Replies: 7
    Last Post: 07-19-2011, 03:03 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