Units position

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Units position

Post by milipili » Fri Jun 13, 2008 7:33 am

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 ?
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Fri Jun 13, 2008 1:12 pm

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
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Fri Jun 13, 2008 2:06 pm

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).
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sun Jun 15, 2008 1:00 pm

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)
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Jun 15, 2008 1:38 pm

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.
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sun Jun 15, 2008 2:38 pm

Yeah, looks like some bugs with facing

Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests