• Create Account

# garrus

Member Since 16 Feb 2013
Offline Last Active Mar 06 2013 05:49 AM

### In Topic: local vs world coordinate system for object manipulation

28 February 2013 - 05:58 AM

Thanks Nercury

^ meant simply the transpose (to get a column vector from [0 0 -1] )

To store each rotation, i'd imagine you mantain 3 angles for the object, which you modify according to user input, and from these you transform the unit vectors of the axes

( [1 0 0] , [0 1 0] , [0 0 1])  to get the transformed orientation.

So i mantain,say,a 4x4 matrix to store the object's orientation and displacement , edit that matrix to rotate/move the object, and glRotate,glTranslate accordingly before drawing the object?

Edit: I guess I should have answered YES. I am actually not sure if maintaining transformation matrix with both rotation and translation for EVERY object has any benefits versus simply calling glTranslate, glRotate.

I meant, keeping such a matrix for every object, and calling glMatrixMult before drawing the object.

If you didn't do this, wouldn't you need to call a glTranslate and 3 glRotates for every object either way?

### In Topic: local vs world coordinate system for object manipulation

26 February 2013 - 03:38 PM

So i mantain,say,a 4x4 matrix to store the object's orientation and displacement , edit that matrix to rotate/move the object, and glRotate,glTranslate accordingly before drawing the object?

Look into my previous post's history, it may give you some ideas.

Thanks, that helped

So is the following correct?

So If i want to move an object to the direction it's facing, since i don't have a "forward" vector explicitly,

i assume that all objects begin facing a certain direciton.

For example -Z direction, and the current direction they're facing is [0 0 -1]^T times their rotation matrix?

Is this how it's done generally?

If so, isn't it processor-intensive to compute all orientations from this?

### In Topic: local vs world coordinate system for object manipulation

22 February 2013 - 02:14 AM

So i mantain,say,a 4x4 matrix to store the object's orientation and displacement , edit that matrix to rotate/move the object, and glRotate,glTranslate accordingly before drawing the object?

### In Topic: local vs world coordinate system for object manipulation

21 February 2013 - 03:18 PM

Usually objects rotations are represented using matrices.

Matrices basically contain the direction of each local axis of an object in world space.

So if your object is not rotated, its local Y axis direction is 0,1,0, X 1,0,0 and X 0,0,1.

If you rotated it upside down the local y axis would be 0,-1,0 (as from the objects perspective, up is down) and possibly X and Z changing (so it wont mirror on some axis somehow...)

You can use them for things like "where in world coordinates is this point, that is at these coordinates from the objects point of view?"

So yeah, read up on matrices for object positioning/rotation.

Yeah, i know about matrices   , but as i'm having problems due to doing everything in world space, using a left,forward..etc vector to perform rotations and displacements for each objects,

as i unsuccessfully inquired about here.

So i thought that it'd be easier doing the above around the (local object axes, and then simply transforming them to world space representation.

You can use them for things like "where in world coordinates is this point, that is at these coordinates from the objects point of view?"

Isn't that a single translation,using the object's position?

PARTNERS