01-13-2010, 06:36 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
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
|
|
01-14-2010, 11:30 PM,
|
|
joevenzon
Administrator
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
Ooh, rainbow road! :-) That's got to be a hard track to drive on.
The transforms are crazy. Sorry about that. When I rewrote everything I had to keep the insanity intact to avoid changing the data. I went back and fixed the car coordinate system:
http://wiki.vdrift.net/Coordinate_systems
but haven't fixed the track coordinate system.
Anyway, it sounds like you have it figured out now. Are you still having trouble reproducing the orientation? One option would be to change the track orientations to match blender like I did with the .car file. I've actually been meaning to rewrite the track file format and combine the track.txt and list.txt and surfaces.txt and so on into one file.
|
|
01-15-2010, 03:41 PM,
|
|
portets
Member
|
Posts: 152
Threads: 12
Joined: Apr 2009
|
|
wow
i really like that track.. alot!
supertuxkart.sourcefourge would probably really like that track too.
for their kart game, you should check it out
|
|
|