tags:

views:

184

answers:

4

I have a game world with lots of irregular objects with varying coordinate systems controlling how objects on their surface work. However the camera and these objects can leave and move out into open empty space, where a normal Cartesian coordinate system is used. How do I manage mapping between the two?

One idea I had would be to wrap these objects in a bounds such as a sphere or box, within which said coordinate system would be used, however this becomes problematic if those bounding objects overlap, at which point I'm unsure whether the idea is fundamentally flawed or a solution can be found, since these objects are moving and could overlap at some point

A: 

Irregardless of the local coordinate system around each of irregular objects, all points will still map to the global world coordinates at one point or another because eventually when you want to render your objects they'll have to get mapped into world space and then camera space. You can use the same object space to world space transform matrices to do the mapping.

Ants
the local coordinate system is not really intended for rendering purposes, more for orientation and mapping purposes, such as little stick figures running around on a pyramids surface, or planes flying around a cone just as if they were flying round the earth (elipsis), physics basically
Tom J Nowell
+2  A: 

I think you should place all your objects in the cartesian 'empty space' coordinate system by composition of your irregular objects coordinates system with the position matrix.

It adds a level, but will make everything easier.

Think Before Coding
this would seem appropriate, its something that would have to be done anyway, I would think I would store a global coordinate and a local coordinate, if not a coordinate relative to the object whose coordinate system is being used
Tom J Nowell
A: 

You can use Lame's coefficients to transform the dimensions of different coordinate systems.

You can transform any kind of coordinate systems, your own as well. The only condition is to have orthogonal dimensions (every dimension has to be independent from other dimensions).

Here is some document I found: link text.

Hope it helps.

niko
hmm that document while seemingly useful is somewhat advanced, thus awkward to understand =(
Tom J Nowell
If I find my lecture notes I can explain it. I don't remember clearly right now therefore tried to find something useful on the web.The concept is not hard to understand if you have a basic understanding of derivation. You can try to find some other nothes using the Lame keyword.
niko
+1  A: 

Regarding the use of bounds I had an idea where the object would use the coordinate system of the smallest bounds it occupied, and then transform according to the heirarchy of systems from top to bottom.

Thus lets say stick figures on a cylinder adjacent to a large object would follow the cylinder rather than flitting between the two objects and their coordinate systems.

Tom J Nowell