Results 1 to 6 of 6

Thread: Coordinate systems

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Lawrence, KS USA
    Posts
    6

    Coordinate systems

    I'm working on an engine that will work both in software and with OpenGL. I'm used to a left-handed coordinate system (with z going into the screen), but OpenGL uses a right-handed system, so I need to switch to that. Is there any advantage to having -z go into the screen? Since you eventually want to divide by z for perspective, doesn't this mean that you'll have to flip the sign anyway (since dividing by a negative z value would flip your x and y values)? So, I guess the question is, what are the advantages of a right-handed system?

    Thanks.

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,342

    Re: Coordinate systems

    What is better i think i mostly of matter of taste. However, if you want z to be positive into the screen you can use glScale(1,1,-1);

  3. #3
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Coordinate systems

    matematicians prefer the right handed system, computer graphics hobbists usually prefer a left handed system because it's more straightforward, even thought it's mainly an historical reason.

    personally i suggest a right handed system, because in computer graphics mathematics is very important, and if one want a quick reference into math texts, the step from abstraction to code is shorter.

    moreover, it's more easy to figure out rotation directions if one thinks with his hands:
    take the left hand (not the right!) and make your thumb points toward you, the index finger point up and the other finger to the right.
    just made up the right handed system coordinate frame.
    to figure out rotations, use the right hand closed with the thumb point outward.
    then, apply the right hand on top of the left hand axis: the direction of fingers of the right hand is the direction of positive rotations around that axis.
    this is also the way mathematics describe such things, like momentum.

    Dolo/\/\ightY

    [This message has been edited by dmy (edited 03-21-2000).]
    Dolo/\/\ightY

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: Coordinate systems

    Hi !

    Just a question : am I crazy coz' I have got my X axis going to the right of the screen, my Y axis going into the screen itself and my Z axis going to the top of the screen ???

    Huh ?

    Eric

    P.S. : I have always thought that having your Z coordinate as the altitude was more logical....

  5. #5
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Coordinate systems

    if it works, it's good.
    when designing/rendering height fields, i too prefer that.

    Dolo/\/\ightY
    Dolo/\/\ightY

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Lawrence, KS USA
    Posts
    6

    Re: Coordinate systems

    Yeah, I've read that flight and sub sims often have z going up and down, 'cuz it makes more sense to have x and y correspond to longitude and lattitude.

Similar Threads

  1. Understand coordinate systems
    By debinair in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-01-2015, 06:38 PM
  2. Need some help transforming coordinate systems
    By brett01 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 03-28-2010, 07:11 AM
  3. Replies: 3
    Last Post: 02-15-2007, 07:27 PM
  4. Rotations in 2 different coordinate systems
    By deadshot in forum OpenGL: General
    Replies: 1
    Last Post: 06-23-2005, 04:29 AM
  5. Opengl support for coordinate systems
    By Nirmalj in forum OpenGL: General
    Replies: 1
    Last Post: 04-17-2001, 04:44 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