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 / Rotation Problem - again

Author
Message
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 4th Nov 2002 18:28
Here I will add my two cents worth to the complaints about problems with rotating objects and pivots etc.

All I need to do is rotate an object in the X & Z axes so it looks like its rolling as it moves in the x & z directions. I have fiddled about trying to find a workaround without success, the problem occurs (in slightly different ways) whatever rotation commands I use (roll/pitch or rotate).

I wrote the bit of code below to illustrate, the really odd thing here is that both cubes should act the same, but the rotation 'bug' seems to manifest itself in different ways for different commands.

If anyone can make these cubes rotate correctly (IE always in/out of the screen with up/down, always clockwise/anticlockwise) I would be very greatful.



Incidentally, this also shows another (associated?) bug, on my PC cube 1 rotates faster than cube 2, this occurs in the fix object pivot command, try adding a few more to make it go even faster! )
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 4th Nov 2002 18:47
There is an error on the lastkey$ line by the way. Its strange how one cube rotates faster than the other though.

Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 5th Nov 2002 15:33
!!! But I just copied and pasted it straight in from working code.

Wait a minute, I`ve seen this before. I tried to run a code snippet from someone else earlier and that had conspicuously missing '=' signs.

I think it may be something to do with the forum itself
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Nov 2002 15:45
Its the pivot command that causes the two cubes to run at different speeds - it probably slows down cube 1.

For the moving, you might be best to use position object

Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 5th Nov 2002 19:40
Thanks, I noticed it was the pivot command (see the first post, after the snippet), you can add more of them to make it go even faster.
But it has to be a bug, you can put a 'wait key 'before the pivot command and then watch it rotate once for the rotate command and again with the Pivot, very odd!

But as for the motion thing, it has to actually roll, imagine you made a ball, now texture it like an Amiga Ball (you know, red and white squares), position object will only move it around, it won`t look like its rolling unless you actually use Rotate, pitch, roll or whatever. Without this it just looks like its sliding.

I really hope this one is fixed soon, its pretty much stopped me developing my current project.
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Nov 2002 12:53
The only way I've managed to successfully rotate an object on it's own x-axis is using this method:

Store the objects orientation in 3 variables: xang#, yang#, zang#
When you want to rotate around the z-axis you have to do this:
-Reset all object axis orientations to 0, so it's facing up along the z axis (ie. rotate object x,0,0,0)

-Now perform your rotation on the zaxis using zrotate object x, y. Because it rotates with respect to the world rather than the object it'll still be rotating around the object because the object is facing in the direction of the world (if that makes sense).

-Now rotate back along the x-axis and then finally along the y-axis using angx# and angy# respectively.

This will allow you to rotate around the objects own z-axis.

Basic steps:
When you want to rotate on the z-axis-
Save x,y,z rotations in 3 variables (xang#, yang#, zang#)
Rotate object x,0,0,0
Perform z-rotation based on your calculations.
Perform x-rotation based on xang#
Perform y-rotation based on yang#

Done.

Machine: P4 2200, 512MB, GeForce4 64MB, Audigy Platinum

There's a junglist inside every coder. http://www.kontact-kru.com for my own personal breakbeat terrorism.
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 6th Nov 2002 14:52
Thanks fallout, but either I`ve missed something or that does not work.
The problem with what you say above is clear if you imagine the object un-rotated to begin with (IE xang#, yang#, zang# will all be zero). Then when you perform the x & y rotations at the end of your pseudo code, nothing happens, and you just end up with a z-rotation again.

Your idea has given me a couple of other ideas I can try though.

Ta
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Nov 2002 16:44
Hope you've e-mailed them about the problem...

Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 6th Nov 2002 16:59
Yes I have, I wanted to get the problem pinpointed first, to do this I eventually came up with the bit of code below, this one Definately works in DB but not in DBPro.
From this I am pretty sure the real problem is with fix object pivot. Its acting as though its not actually resetting the pivot, but instead is remembering the total rotation that has been applied to the object so far, and then re-applying that each time.
Oh and you can still put in more fix object pivot commands to make it spin faster.

Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 7th Nov 2002 23:12
Sorry, I tried my technique last night and it failed also. In fact, I cant find a work around either. It's really starting to get to me. I thought the db team would've learnt from their mistakes with db.

Here's some annoying bugs I've found that are so fundamental it hurts:
(1) zrotation is almost impossible. You cannot rotate something properly in 3D space. They made this mistake in db! How could they possibly make it again? It means my 3D car physics engine is only half working.
(2) Polygon collision doesn't work properly. This is another fundimental problem. My space sim is on hold now until I can actually check if two objects are colliding or not. It works only some of the time, which obviously isn't good enough.
(3) Get ground height, another fundamental command doesnt work. You have to offset the position of detection for some reason.

As far as I'm concerned errors 1 and 2 make it almost impossible to make a decent game. Spherical and box collision are fine for some games, but many games will require precision collision at some point, and that's not possible at the moment. Also, the z rotation problem is just absolutely discusting. It only takes 2 minutes to test these functions and realise there's a problem with them. Maybe they had to rush out version 1, but patch 1 or 2 didn't even fix these!

Anyway, enough wining. I know by now it doesnt do any good. It's just annoying that the db team create such a brilliant program with so much potential, but it's impossible for me to ever complete a game. Either it's rotation problems, speed limitations, object animation problems, texturing issues etc. I can appreciate a program like this will have bugs. I'm not nieve. But these bugs are too big to be acceptable.

Right ... winge over.

Machine: P4 2200, 512MB, GeForce4 64MB, Audigy Platinum

There's a junglist inside every coder. http://www.kontact-kru.com for my own personal breakbeat terrorism.

Login to post a reply

Server time is: 2024-04-20 09:59:16
Your offset time is: 2024-04-20 09:59:16