Results 1 to 6 of 6

Thread: How to find object orientation?

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    France
    Posts
    23

    How to find object orientation?

    Hi,

    I try to explain you my problem. I take an example. I have some cubes with different textures on each face. The goal is to rotate the cubes to built the good image like a puzzle. Now i want to know when someone wins the game i.e. when the cubes are in the correct orientation. I can store the 3 angles on x, y and z but as you preaphs know, making a rotation on y and on x and on z ... is not making a rotation on z and on y and on x. The order is important. So i can't only compare the actual x,y,z angles to some final x,y,z values. In other words, i can't say the cube is in the correct orientation for instance if x=250,y=120,z=30.
    Is someone has an idea, it will help me very much.

    thanks
    TORNIERI Christophe
    Ecole Supérieure en Sciences Informatiques

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Italy
    Posts
    124

    Re: How to find object orientation?

    Keep a local system of vectors xloc, yloc and zloc...
    I heard about quaternions, but I still ignore what they are
    However they (maybe) have to do with your problem...
    tFz

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    763

    Re: How to find object orientation?

    Hello,

    quaternions are a way of expressing rotations. Its theory is based on an extension to the complex number system with even more imaginary numbers. Ultimately, however, quaternions spefify a rotation by a rotation about some arbitrary vector. In fact, the parameter glRotate*() is actually a quaternion. They're specially useful for tweening rotations. Check out:

    "Animating Rotation with Quaternion Curves," K.Shoemake, Ccomputer Graphcis, V.19 N3, 1985

    and

    "Smooth Interpolation of Orientations with Angular Veolcoity Constraints using Quaternions", A.H.Barr, B.Currin, S.Gabriel, J.F.Hughes, Computer Graphics 26, 2, 1992

    cheers
    John

  4. #4
    Junior Member Newbie
    Join Date
    May 2001
    Location
    France
    Posts
    23

    Re: How to find object orientation?

    hi,

    Thank you for your help.
    TORNIERI Christophe
    Ecole Supérieure en Sciences Informatiques

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: How to find object orientation?

    glRotate is a quaternion? I always assumed it was and axis and an angle?

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,502

    Re: How to find object orientation?

    Correct, glRotate is an axis and angle, not a quaternion. An axis and angle does map one to one and onto the set of unit quarternions however. But that mapping has nothing to do with glRotate.

Similar Threads

  1. Object orientation with respect to camera
    By ProofKhan in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 07-15-2013, 02:42 AM
  2. Calculate object orientation from a quaternion
    By JohnnyDread in forum OpenGL: General
    Replies: 1
    Last Post: 02-06-2011, 11:15 PM
  3. Drawing object with orientation vector
    By Coluna in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-16-2003, 08:30 PM
  4. data structure for object orientation
    By satan in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-20-2002, 03:21 PM
  5. How to know the orientation of an object?
    By ChrisT in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-07-2001, 11:40 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