Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Again, the rotation bug

Author
Message
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 29th Sep 2002 21:21
Ok, I've been trying to figure out some work arounds with the TURN OBJECT (and the like) and the XROTATE OBJECT (also, and the like). So far, other than a couple of headaches, nothing has come from it. After a few thousand Pepsi's and donuts, I've come to the conclusion that YROTATE and ZROTATE rotate around the world axis, but it seems that XROTATE rotates around the object axis.

TURN OBJECT is completely out of the question as it doesn't turn the object's "angle of motion." It just seems to turn the mesh animation. Try it out with an object. You'll see what I mean.

My question is, how do you get an object to perform freeflight rotation and motion manually?

I've about given up. Please tell me patch 2 is coming soon.
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 30th Sep 2002 10:44
XROTATE happens first(unless you change the order of rotation) so it will appear to rotate about the objects X axis as that matches the world access.

As for the free flight commands, I've reported bugs about them on DBDN but I'll check out the direction of motion problem.

The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 3rd Oct 2002 22:07
If found a way to do rotation, kindof, in free flight.



In the above code, if you rotate around the y and z axis only! it YAW correctly. However, I notest that if you PITCH (X Rotation) it screws it all up. I'm still refining it though. What I wanted to be able to do is find a programming way of Freeflight instead of using DBP's functions. I'd have more control over it anyways.

Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 3rd Oct 2002 23:56
If you realy want the code for free flight I can look out the stuff I did in VB5 but you need to understand matrix maniplation like dot products, what an orientation matrix is and about normalizing vectors. Then you need to apply this to your models so you will have to manipulate the vertex data and normal vectors using the orientation matrix.

Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 6th Oct 2002 06:02
This could be interesting, please do dig up this stuff.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 6th Oct 2002 13:21
Ok I'll paste all the functions and type defs that I think you need. Hope it helps!

Note: D3DVECTOR is, as you would expect var.x,var.y & var.z



Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 6th Oct 2002 13:46
Oops missed an importatnt bit.

BTW this is VB5 code so you can't just cut and paste.



The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 6th Oct 2002 20:09
Yeah, I'd like to see it! I don't know too too much about matricese and 3D but I got a billion books on that kind of stuff.

1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 6th Oct 2002 20:11
SWEET! I like it alot!

1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 6th Oct 2002 20:11
TAHNX!

1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 7th Oct 2002 10:02
If you have any trouble I think I got most of the info to write those routines from Ian (co-writer of Elite) Bell's
web site.

Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 9th Oct 2002 13:12
Thanks. At first glance looks complex. I like

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 11th Oct 2002 20:14
Any idea how to implement with DBPro rotate commands?

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 11th Oct 2002 21:05
You can't - you'd have to work onto the mesh directly by copying it into a memblock.

Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 11th Oct 2002 21:14
Ah.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Andy Igoe
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 13th Oct 2002 16:10
I just posted a DB-easy workaround to rotation in spaceflight engine thread - for completeness i'll post it here too.

function turn(obj,amt#)
set object to object orientation 1,obj
turn object right 1,amt#
set object to object orientation obj,1
endfunction

Do the same for pitch and roll and you are laughing. Object 1 is a hidden plain of 1x1 in size and used purely as a handler object.

This method also allows you to read the object angle x/y/z(obj) values without resetting the rotation to 0,0,0.

Pneumatic of Xev@EQ

Life outside of MMORG's costs more, rewards less and features no end game content.
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 13th Oct 2002 18:19
Have you tried it yet? Set object to object orientation may have it look like it's pointing in the right direction, but with turn object only turning the object's mesh, the object will still be pointed in the old direction. Nice try, but it doesn't seem to work for me.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 13th Oct 2002 18:27
I agree with Milamber on this one. For some reason turn object works on the objects mesh when it should work on the objects orientation matrix (the matrix that describes the object up, forward and left or right vectors).

Andy Igoe
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 15th Oct 2002 01:37
You can't just drop it in and expect it to fix all your woes you are looking at the problem too deeply, think basic.

What it does is allow you to continue to use rotate object x() and object angle x() together with the normal turn, pitch and roll commands. This meens you can continue to use normal rotation controls and just rotate the broken axis with the new function call.

This is just one way i've gotten around the rotation bug, and it works for me.

Other options include fixing the object pivot and rotate individual axis in turn. Then return to 0 after sync. This works well for making tanks roll over terrain but would not work in a flight sim, because you can only use 2 axis to calculate movement.

rotate object x obj,amtX#
fix object pivot obj
rotate object z obj,amtZ#
fix object pivot obj
sync
rotate object z,obj,-amtZ#
fix object pivot obj
rotate object x obj,-amtX#
fix object pivot obj

Anyway both these solutions work for me and i've used them a lot in DB1, admitedly not in DBPro yet as i'm taking ages to work around all the bugs. Grrrrr.

Pneumatic of Xev@EQ

Life outside of MMORG's costs more, rewards less and features no end game content.
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 16th Oct 2002 06:47
If you turn object left 90, you would normally expect the object angle y to be 270, right? It's not in DBPro right now. It's still 0, but the MESH of the object has been turned. Also, the next time you use one of the rotate object commands, it will revert the mesh to the starting position, and the next time you use one of the free flight rotation commands, it will revert the mesh to its rotated position, then rotate the mesh further. Also ,right now, the free flight rotation commands appear to work on radians, not degrees.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 16th Oct 2002 21:34
The latest beta version of the patch fixes mose of the free flight commands. I've reported the on problem I can still find.

Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 19th Oct 2002 13:33
Which is?

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Zed
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 19th Oct 2002 18:56
I can't remember now but it's fixed in Beta 4 - object to camera orientation stll not working thought!

Login to post a reply

Server time is: 2024-04-19 20:33:05
Your offset time is: 2024-04-19 20:33:05