The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
VDrift coordinate system - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4)
+--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9)
+--- Thread: VDrift coordinate system (/showthread.php?tid=1206)



VDrift coordinate system - NaN - 01-10-2010

I've been thinking about moving the track editor functionality into blender. But I am somewhat irritated by the coordinate transforms.
A vertex(parkinglot track) in blender (-15, 179, 4.5) has the following coordinates in the track editor (179, 4.5, -15) :o

edit:
This means a 90° rotation around x-axis followed by 90° around z-axis?


- NaN - 01-13-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 Tongue
[Image: test10v7gi.jpg]
[Image: testxs5f3.jpg]


- joevenzon - 01-14-2010

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.


wow - portets - 01-15-2010

i really like that track.. alot!

supertuxkart.sourcefourge would probably really like that track too.

for their kart game, you should check it out


- NaN - 01-15-2010

Yeah, the track is a homage to Mario Kart 64. Big Grin


- NaN - 01-29-2010

Hey Joe

I had a look at some of the track JPKs in blender. They have z-axis as up-axis. So the coordinate system transforms affect roads.trk, track.txt only?
I could write a tiny script to fix the coordinate transforms in this files.

Or we change the track file format now. Joining track.txt and surfaces.txt and roads.trk. (I am almost done with the import/export trk scripts.)


- joevenzon - 02-01-2010

So, what's the coordinate system now, and what's the desired coordinate system? Is the desired coordinate system the opengl coordinate system that VDrift uses to render stuff (Y=up)? Or is the desired cooridnate system the blender coordinate system (Z=up)?


- NaN - 02-02-2010

Personally, I would prefer the opengl(Y=up) orientation to get rid of the fix rotations in the code. I would modify the importer/exporter scripts and update the JOEs and JPKs. We would lose compatibility to old data. This could cause confusion among users/contributors Sad


- joevenzon - 02-04-2010

Maybe increment the version counter on the .joe files, process them to change their rotations to the Y=up coordinate system, then (at runtime) if it's the old version, apply the rotation fix, if not, don't. Eventually once there are a couple of releases out with the newer coordinate system support, remove support for the old. What do you think?


- NaN - 02-04-2010

Sounds good. So the next step is moving the rotation fixes into the joe loading code?


- joevenzon - 02-05-2010

Yeah, that sounds good.