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 / Rotate, turn, world, object, ARRRGGG!

Author
Message
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th Nov 2002 18:23
I am currently trying to get to grips with 3D movement commands and it's driving me mad. Some commands rotate in respect to object, some to world and some just appear to do what they want.

I understand many people are having problems with free-flight commands and next patch may fix these oddities.

Is it worth me trying to do workarounds or should I just wait?

Why can't it be nice and simple and there be a set of commands so I can choose whether to rotate around the object axis or the world axis.

Can anyone also explain what the point of turn, pitch and roll commands are for as they appear to rotate object on screen but leave object's orientation the same.
I love it when a plan comes together
Matto
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location:
Posted: 12th Nov 2002 04:48
well as far as rotating goes the object rotation should be able to be accompished by using the :

Rotate Object "object number here",x axis rotation,y axis rotation,z axis rotation

an example would as follows (click the code button):~



you can change the objects x,y and z axis movement individually by using the :~
XRotate Object "object number here","rotation value here"
or y and z rotate object commands which are the same but replacing the X from the above example with y or z

I hope this helps for the rotation of the object at the objects position, if you are still unsure of the pitch and roll features then reply saying what you need help with and I will try and help some more

1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 12th Nov 2002 21:09
Thanks for the info, but I'm not that much of a beginner ( I've been programming for nearly 20 years)

After more investigation I have come to conclusion that trying to do a free-flight game is pointless, as even trying to get a cube to move around in free space is impossible with current commands.

XROTATE rotates an object about the x-axis of the object : all well and good and acts as expected

YROTATE rotates object around the WORLD y-axis, not the object's y-axis : Why? but after doing any zrotate's even this screws up

ZROTATE rotates SCREEN object about world z-axis but leaves object pointing in original direction.

How confusing!

Is it at all possible to rotate an object about the y or z axis of the object itself?

Maybe I need to read up about this 'euler' rotation thing on the net.

I love it when a plan comes together
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 13th Nov 2002 00:50
You could try the pitch, turn and roll object commands. They make free flight very easy, unless you want to do specific rotations. They all rotate relative to the object, so unless you want your plane tilting 90 degrees whenever it turns, you'll need to mess about with turning it. If you've had flight experience with the yoke and the rudder you'll know. Can I be bothered to put together an example? Yes, actually.

On second thoughts, these commands don't work at all in DBPro. Damn. None of them seem to affect the actual motion, and the rolling is around world coordinates.
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 13th Nov 2002 00:51
Try this code, and see what happens. I'm not using any patches so it didn't work on my machine.

Matto
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location:
Posted: 13th Nov 2002 02:05
Sorry Sonic, just sounded like you were new new.. not old new.. if you get my drift.. seems you know more than me anyway, there is a free flight program in DB1 is this not able to be converted to DBP??

1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name
Matto
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location:
Posted: 13th Nov 2002 02:14
Another point on free flight is that the space is not limitless, I found this in version 1 of DB and can probably dig out the info still I found on it, but in basic form I tried flying around space at 1 unit at a time in a given direction, what happend was at certain points the 1 incremented by*2 and that by *2 etc etc until 1 became a move of 256 and after travelling 2 billion or so units away from the centre point of space (0,0,0) you wrap back to minus 2 billion or so and come back in to the centre and the moves then reduce as they gained so from 256 to 128 etc.. this is because space in DB is not infinite it is finite, apparently the problem wouldn't be as big in DBP as the signed integers are bigger than in DB1 I see this as being the same problem but bigger.. but then I am wrong on several things so this wouldn't be the first , anyway just a point I found in DB1 that may effect a free flight game. Lee kindly replied to me on this very topic when I found it and I can produce his comments if need be or it interests you. If my memory is true as ever I could have missed or miss-remembered some valid points .

1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name
Drunken Fingers
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Nov 2002 03:15
The very first post sums it up for me with DBPro on the freeflight controls too. Patch 2 doesn't help.

Off the topic a little but I was expecting to run into the max size of space problem so I'm playing with an idea to test the values of WHATEVER object. If your x, y, or z is bigger than 100,000,000 or so then walk through all the objects, cameras, matrixes, lights, etc and subtract 100,000,000 from them. If done right nobody should notice. You get the idea.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 13th Nov 2002 12:33
There are some bugs in both the Rotate object and pitch/turn/roll commands, you might want to check out -

http://www.darkbasicpro.com/apollo/view.php?t=1488&b=1

Where some of us discussed it.

In one of the later posts there I placed a piece of code that works fine in DB but gets it wrong in DBPro, thereby pretty much confirming that its a DBPro bug.

Also none of us have been able to find a work around, as all the commands appear flawed, so we will just have to wait and hope it gets fixed in release 3.
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2002 13:13
I think I will give up (for now) on trying a free-flight type of game and stick with a normal FPS or flying game using only xrotate and yrotate.

I tried using all those pitch, turn and roll commands but they only affect the on-screen object and not the actual angles of the object.

As a sidenote, can anyone tell me how to get the actual world co-ordinate of a limb attached to an object.

Try code below



Documentation claims that 'limb position x' will tell you, but it just stays at zero as well as the limb's other positions and angles.

As the cube rotates, the small red box 'limb' rotates quite happily with it but it's position and angle can not be deduced. I would like to know it's world co-ordinates to place cameras, lights, e.t.c.

Yes I am an 'old new' programmer but once a new language comes along, I insist on knowing how to use every command individually before I even start a proper game. This is why I haven't posted any proper code yet.

I love it when a plan comes together
Matto
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location:
Posted: 13th Nov 2002 18:23
I can understand the reasoning behind the learning each command before attempting anything... things do take longer to get off the ground this way but it helps in the long term there's no doubt about that.

1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name
Drunken Fingers
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Nov 2002 19:42
Quick thought on a work around. I haven't tried it yet. The pitch and roll commands work for the camera. Use a camera, say camera 2, and apply your free flight commands to it, then get the xyz camera angle and position info from camera 2 and copy them to your object.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 14th Nov 2002 11:15
I just gave that a quick try DrunkenFingers and came across a couple of problems.
Firstly camera angle x/y/z(2) just returns zero (like its reset the object pivot, maybe its supposed to for the pitch/roll commands?).
Then I tried SET OBJECT TO CAMERA ORIENTATION, but this has no setting for camera number. So I added set current camera 2 with SET OBJECT TO CAMERA ORIENTATION and it actually moved my object to a new position.
So I swapped the cameras round, and it still did not work.

So I gave up, shame, that was a nice idea, sooooo close.
Lee Bamber
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location:
Posted: 15th Nov 2002 22:12
Until Patch 4, you might have a better time avoiding free flight rotation and orientation commands. There is some strangeness in there that I am not happy with. We are waiting for patch 4 as this will rewrite the rotation code and so temporary patch 3 fixes will just get erased.

spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 16th Nov 2002 00:55
Thanks Lee for finally confirming that free-flight stuff is not worth bothering with yet. I'll keep my wild ideas until next year and carry on with some simple puzzle / FPS games I want to do.

Anyone:
I would still like an answer to my 'limb' query 5 messages above this one on how to get real-world coordinate of a limb as I can't get built-in commands to work.

Thanks.

I love it when a plan comes together
Matto
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location:
Posted: 16th Nov 2002 02:31
I have had problems with limb actions and infact even the limbs being recognised in my objects, where in 1 they are fine and I checked the limb numbers on a limb number checker, in DBP they are not recognised correctly or it is because there is something different about limbs in DBP that I am unaware of.. I keep getting strange errors in this department so far though no matter what I try..

1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 20th Nov 2002 17:36
Thanks for the confirmation Lee, at least I know now to stop fiddling about trying to find a work around and to get on with other stuff.

Login to post a reply

Server time is: 2024-04-19 04:22:48
Your offset time is: 2024-04-19 04:22:48