|
From: TIMOTHY K H. <tkh...@ve...> - 2006-11-27 17:32:42
|
Wow, that's... bad. Really bad. I had been suspecting that I might have been mis-translating ccordinates between ODE and openGL, but what you're describing looks like a problem completely internal to ODE itself. I'll see what I can do with it today, and get you some feedback by this afternoon. -Tim Nathan Clow <n_...@ho...> wrote: Some bad news: There appears to be a bug in ODE with dBodyVectorFromWorld. I think the function is bugged and returns sign errors on its values. Here's my logic: The body starts at position 0,0,0 with normal (unrotated) rotation values. The axes of the body are initially aligned with those of the world. Here are sample dBodyVectorFromWorld translations while the body is unrotated, with the world vector on the left and the relative vector on the right. [100,0,0] -> [100,0,0] [0,100,0] -> [0,100,0] [0,0,100] -> [0,0,100] So, based on this, I created the notion that for relative vectors, +x is to the right, +y is upwards, and +z is in front. Both the global and relative coordinate systems seem to be aligned at the start while not rotated. So, one would expect that, if given a point 100 units to the right, a simple YAWCW would rotate you 90 degrees to the right until you're facing it. You'd expect your relative vectors during this time to start with [100,0,0], to range intermediately between [n, 0, m] with n and m from 0 to 100, and to end at [0,0,100]. That's not what happens. Here's some sample output from the situation described above. Pos: [0.000000 0.000000 0.000000] DestPos: [100.000000 0.000000 0.000000] Derived world vector [100.000000,0.000000,0.000000] from navQueue Derived relative vector [98.828865,0.000000,-15.259607] from navQueue Translated back to world vector [100.000000,0.000000,-0.000000] See how z is negative? I don't know how this can be. The point is approaching the "front" of the ship as it rotates. Z should range up to 100, not down to -100. This is just an example. The long and short of it is that 0 to 3 of the values may have the wrong sign depending on the situation, and that I have no way to tell when this will happen and thus correct the sign errors. I think the bug occurs because of the way the rotation matrix works in ODE, but I don't really understand what the values in that matrix are supposed to be (despite spending a lot of time looking at it). I've been over this and over this and can't find any error in my understanding of what is supposed to be happening. I suppose there could be a problem in the engine code or the graphics code or something else, causing what we see to be different than what ODE knows, but I think that's pretty unlikely. So this was like hitting a brick wall. I have no idea if I could write a working vector translation function before Thursday. Give me your feedback if you have any. I'll approach the problem again tomorrow with a fresh mind. _________________________________________________________________ Get free, personalized commercial-free online radio with MSN Radio powered by Pandora http://radio.msn.com/?icid=T002MSN03A07001 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Eighthfleet-development mailing list Eig...@li... https://lists.sourceforge.net/lists/listinfo/eighthfleet-development |