Page 1 of 1

Units position

Posted: Fri Jun 13, 2008 7:33 am
by milipili
Under OS X, I can not see my units although I can select them.
I suppose bad values for X/Y/Z axis.

Where can I start from to check those values ?

Posted: Fri Jun 13, 2008 1:12 pm
by zuzuf
Units use 2 VECTOR for position and orientation: Pos and Angle

It uses Euler angles (yes very basic but very convenient with OpenGL way of doing rotations), so Angle.x is how much it turns around X axis, etc... WARNING: Internal angles are in degrees !!! TA angles are in 64K format and trigonometric functions work with radians (we have conversion constants RAD2DEG, DEG2RAD, TA2RAD, TA2DEG, ...).

The selection mechanism uses the angles from the UNIT object, so if you can select units then the angles aren't aberrant (ie NaN). I think it has probably something to do with OpenGL state at drawing time.

PS: I am back home tonight, I'll be able to work on that soon

Posted: Fri Jun 13, 2008 2:06 pm
by milipili
With your explanation, it seems indeed there is an issue with angles. May be there is a difference somewhere with Darwin (I suppose it works well on Nux and Win).

Posted: Sun Jun 15, 2008 1:00 pm
by milipili
Actually it seems that the problem comes from angles, as we can see on those screenshots :

http://ftn.shikami.org/misc/ta3d/bugs/angle1.jpg
http://ftn.shikami.org/misc/ta3d/bugs/angle2.jpg
http://ftn.shikami.org/misc/ta3d/bugs/angle3.jpg

(Metallo are on the same line than the factory, near the radar, not near the sea)

Posted: Sun Jun 15, 2008 1:38 pm
by zuzuf
does it render correctly if you aren't building anything ?

models are rendered in wireframe mode to render the build animation, if it doesn't leave this drawing mode correctly you may see everything in wireframe.

Posted: Sun Jun 15, 2008 2:38 pm
by Balthazar
Yeah, looks like some bugs with facing