[Flightgear-devel] Coordinate system in multiplayer protocol

2003-08-03 Thread Tyson, Diarmuid
 Hi
 
 I am trying to use Flightgear as a GUI for an air traffic simulator.
 I use the CVS head and the multiplayer mode  (--multiplay=in,10,,5500)
on
 a gnu/linux intel box.
 
 I though the positions were in meters in a geocentric frame.
 When i start in the default position KSFO:28L (-122.358, 37.6117) I
read
 the following x,y,z [2985, 2063, 4350] from the socket.
 When i send these coordinates back, the plane shows up at the right
place.
 
 I noticed that sqrt(2985^2 + 2063^2 + 4350^2) = 5664 wich seems far
from
 earth radius.
 
 When i do the computation myself, i find (-122.358, 37.6117) -
[-2708844
 -4272575 3871453]
which leads to 6370312 for earth radius and seems closer to
reality.
 
 What am I missing ??? Regards
 
 Antoine
 

Antoine,
Sorry for taking a while to get back to you.  I've been away from work
for a week.

If you have a browse through the multiplayer code, you'll notice that we
don't pass X,Y,Z's over the network at all.  We pass a transformation
matrix that can be applied to a 3d model, to move it to its new
position in the world.

Why?  Speed.  We've gone to all the trouble of calculating our own
transformation matrix from X, Y, Z  orientation.  Sending the X, Y, Z 
orientation out over the network would cause all the other network
clients to have to recalculate the model transformation matrix.

If you'd prefer for X, Y, Z and orientation to be transmitted in the UDP
packets, (which has many advantages - especially when using a central
server), then it would be a simple change in the code.  Have a go - if
you get stuck then I'm happy to help.

Diarmuid Tyson.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


[Flightgear-devel] Coordinate system in multiplayer protocol

2003-07-29 Thread antoine
Hi

I am trying to use Flightgear as a GUI for an air traffic simulator.
I use the CVS head and the multiplayer mode  (--multiplay=in,10,,5500) on 
a gnu/linux intel box.

I though the positions were in meters in a geocentric frame.
When i start in the default position KSFO:28L (-122.358, 37.6117) I read 
the following x,y,z [2985, 2063, 4350] from the socket.
When i send these coordinates back, the plane shows up at the right place.

I noticed that sqrt(2985^2 + 2063^2 + 4350^2) = 5664 wich seems far from 
earth radius.

When i do the computation myself, i find (-122.358, 37.6117) - [-2708844 
-4272575 3871453]
  which leads to 6370312 for earth radius and seems closer to reality.

What am I missing ??? Regards

Antoine

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel