Results 1 to 6 of 6

Thread: rotating and keeping coordinates

  1. #1
    Member Newbie
    Join Date
    Mar 2002
    Posts
    34

    rotating and keeping coordinates

    I have a bunch of coordinates that I've used to draw a polygon centered around the origin: If I rotate the polygon a certain number of degrees about the origin, those coordinates will all move to new spots. I would like to know the values of the new coordinates after rotation has occured. Can OpenGL do this, or does it have to be done mathematically?

  2. #2
    Guest

    Re: rotating and keeping coordinates

    Originally posted by Rajveer:
    I would like to know the values of the new coordinates after rotation has occured. Can OpenGL do this?
    If you define a rotation, OpenGL will display the next objects rotated by that amount you specified, but you can't get the numerical values of the object coordinates. OpenGL is not a mathematic library , sorry.

  3. #3
    Member Newbie
    Join Date
    Mar 2002
    Posts
    34

    Re: rotating and keeping coordinates

    I see....
    Well do you know of any existing libraries that would do something like this? Or do you know where I could get information for such a library?

  4. #4
    Member Newbie
    Join Date
    Apr 2002
    Location
    Split, Croatia
    Posts
    43

    Re: rotating and keeping coordinates

    I think something like this is posible using GL_FEEDBACK rendering mode and
    glFeedbackBuffer function.
    I'm not 100% sure,I never used those, but maybe that is what you are looking for.
    Good luck experimenting!

  5. #5
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: rotating and keeping coordinates

    Originally posted by mproso:
    I think something like this is posible using GL_FEEDBACK rendering mode and
    glFeedbackBuffer function.
    I'm not 100% sure,I never used those, but maybe that is what you are looking for.
    Good luck experimenting!
    OpenGL is not designed to be something that returns values you've already input. You could grab the modelview matrix if you really wanted (glGet* funcs), but there is a performance hit involved in doing so. Feedback stuff is not really ideal for this IMO. in the long run it's better to store and retrieve the values yourself (which you have to do anyway...), usually in some form of hierarchical tree.

    You may well be able to find a shareware or freeware scenegraph API if you really do need to do that, but ultimately you've hit the realm of software engineering.

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: rotating and keeping coordinates

    As stated above OpenGL isn't ideal for that. It's better you do the maths yourself and code it.

Similar Threads

  1. Keeping X, Y and Z data separately
    By sinaxp19 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-05-2015, 07:49 AM
  2. Two cubes: rotate one of them keeping still the other one.
    By tiregarfio in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-25-2006, 03:57 AM
  3. Keeping track of vertices??
    By MaNDROiD in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-27-2004, 12:40 AM
  4. Rotational mathematics... rotating cartesian coordinates
    By ax_deimos in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-21-2001, 06:50 AM
  5. keeping up with the Industry
    By Bassman in forum OpenGL: General
    Replies: 12
    Last Post: 06-17-2000, 02: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