Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Velocity/heading. Cartesian or spherical coordinates?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 bobbias   Members   -  Reputation: 120

Like
0Likes
Like

Posted 15 May 2012 - 06:57 AM

I'm working on a game in Java using lwjgl for opengl. I'm working on designing my general "model" representation and I'm stuck trying to decide how I want to represent the heading/velocity of a model. Opengl uses Cartesian coordinates, but I' wondering if there's any reason I should store the model information natively as spherical coordinates... I can't figure out the pros and cons to it.

So I guess what I'm asking is, how does everyone else store the heading/velocity data for your models and why do you store it that way?

Sponsor:

#2 Slavik81   Members   -  Reputation: 360

Like
0Likes
Like

Posted 15 May 2012 - 12:47 PM

That depends on how you acquire the data and what you're going to use it for. Whatever the case, the velocity will need to be adjusted each time the position changes (assuming you're travelling around a sphere). What sort of game is it?

It's much harder to do things like line-of-sight or shortest path checks with spherical coordinates. The poles in particular are very annoying.

#3 codeToad   Members   -  Reputation: 142

Like
0Likes
Like

Posted 15 May 2012 - 05:06 PM

Does openGL provide methods for obtaining matrices that perform rotation, translation, and scaling? If so, they are going to have cartesian coordinates as their input/output. Even if you are making your own methods to do these things, it should be easy to google the mathematics necessary to do so. I don't know if it's even possible to perform transformations on spherical coordinates using matrix multiplication. (If it is, it'd be an interesting math lesson Posted Image ).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS