Coordinate system matrix

Hi all,

How could I to obtain a matrix of my own coordinate system? I know all three directions and origin point.



I dont really understand what you want.
Lets assume that you have vertices defined in what you called your own coordinate system. If vectors (X, Y, Z) are your 3 directions, and T your origine point, then the matrix that transform your vertices to the upper coordinate system is :

GLfloat matrix[16] = {
Xx, Xy, Xz, 0
Yx, Yy, Yz, 0
Zx, Zy, Zz, 0
Tx, Ty, Tz, 1

If you want to inverse this (if what you call your own coordinate system is your camera for example, and that you have the dirs and position of your camera in the absolute coordinate system and look for the dirs and pos of the absolute coord system in your camera coordinate system), apply this :

transpose(GLfloat (*matrix)[]) {
GLfloat x,y,z;

which transpose the rotation part of the matrix (assuming the matrix is orthogonal), and calculate the translation from center of your coordinate system to absolute coord system in the matrix coordinate system.

May the force be with you.

[This message has been edited by rixed (edited 08-13-2002).]

Thank you for your answer Rixed,

I want to use “own coordinate system” to define sketch plane.


I still do not understand what you want to do nor what you call a sketch plane, but anyway, if that helps… :slight_smile: