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 Discussion / 3rd Person View Gone Awry

Author
Message
Relativity
20
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 26th Aug 2005 03:10
These are two attempts at a very simple third person view. Both have problems I don't understand. The first uses standard Euler rotation:


The big problem with that one is that the cube doesn't face the same direction as the camera when you move the mouse.

The second one is the same thing only with Free Flight Rotation. It looks like it works fine at first glance but when you move the mouse around for a while you will notice that it starts to move around the z-axis.


I tried using INT() on that one, thinking the problem might be round-off error with the MOUSEMOVEX() and MOUSEMOVEY() commands but it didn't seem to have an effect. I would appreciate any thoughts to the reasons to these two problems. Thanks.

This is a test. This is only a test. If this were an actual emergency you'd all be dead.
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 26th Aug 2005 03:22
Try this. (If the object your moving is object 2)



Put that in the loop in place of your camera commands. Camdist# and camhigh# are the value you need to change if you want to move the camera to follow farther or away, higher or lower.

Happy game making.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 26th Aug 2005 12:56
SithSpawn,

Here is a math alternative.




+NanoBrain+
Relativity
20
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 26th Aug 2005 17:03
Perhaps I should have specified that the object the camera is following is changing its x-, y-, and z-angles and doesn't stay in one plain. More like a space simulator in 3rd person.

Also, I'd still like to know why the two snippets I posted above have problems.

This is a test. This is only a test. If this were an actual emergency you'd all be dead.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Aug 2005 22:59
There is a known problem with DB Classic 'out of the box' when it comes to object rotation, but I don't remember exactly what it was or what you do to get round it.

All I remember is that it's something to do with 'gimble' or 'gimbal' - whatever that is lol, and I think Fix Object Pivot came into the fix somewhere!

Sorry It's not much help (not my field of expertise I'm afraid), but this might point you in the right direction to ask for further help.

TDK_Man

Login to post a reply

Server time is: 2025-05-22 12:41:05
Your offset time is: 2025-05-22 12:41:05