Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VDrift coordinate system
01-13-2010, 06:36 PM,
#2
 
I had a look at the code. So we have:

Code:
TRACK::LoadParameters()
...
pos.Set(f3[2], f3[0], f3[1]);
...
QUATERNION <float> orient(f3[2], f3[0], f3[1], f1);

So what do we have here take position xyz from start position and load it as zxy. The same happens to the orientation.

Code:
bool CAR::Load
...
//due to historical reasons the initial orientation places the car faces the wrong way
fixer.Rotate(3.141593,0,0,1);
dynamics.SetInitialConditions(initial_position, fixer*initial_orientation);

Load applies a 180 degrees rotation to the orientation around z-axis.


Code:
void CAR::CopyPhysicsResultsIntoDisplay()
.....
quat = dynamics.GetOrientation();
fixer.Rotate(-3.141593*0.5, 0, 0, 1);
bodynode->GetTransform().SetRotation(quat*fixer);

The orientation is updated by the physics multiplied with a -90 degrees rotation around z-axis(the fixer again).

Well, I've got a track export plugin which allows to do the complete track setup/creation within blender. But not being able to reproduce this orientation transforms in the plugin it returns incorrect orientations.

PS: My test track for the track exporter Tongue
[Image: test10v7gi.jpg]
[Image: testxs5f3.jpg]
Reply


Messages In This Thread
VDrift coordinate system - by NaN - 01-10-2010, 01:14 PM
[No subject] - by NaN - 01-13-2010, 06:36 PM
[No subject] - by joevenzon_phpbb2_import3 - 01-14-2010, 11:30 PM
wow - by portets - 01-15-2010, 03:41 PM
[No subject] - by NaN - 01-15-2010, 04:04 PM
[No subject] - by NaN - 01-29-2010, 06:25 AM
[No subject] - by joevenzon_phpbb2_import3 - 02-01-2010, 11:02 PM
[No subject] - by NaN - 02-02-2010, 04:25 PM
[No subject] - by joevenzon_phpbb2_import3 - 02-04-2010, 11:25 AM
[No subject] - by NaN - 02-04-2010, 04:56 PM
[No subject] - by joevenzon_phpbb2_import3 - 02-05-2010, 11:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)