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.

Newcomers DBPro Corner / Jerky Camera Movement (DBP)

Author
Message
Mirthin
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Land of the Rising Haggis
Posted: 8th May 2006 18:11
Hi. I'm using DBP to get some kind of 3rd person environment up off the ground. I've got a textured matrix, a textured skysphere (which is 'tied' to the camera so that it follows the camera movement). I've also got an animated 3D character, which plays an idle animation whilst still, and a walking animation whilst moving forward, backward, turning left and right.

I then implemented the 'SET CAMERA TO FOLLOW' command, to make the camera follow the character. When I'm turning, the camera maintains the angle behind the character. When I walk forwards or backwards when the character is at angle 0 (as in, moving directly up and down the Z axis) everything's fine - the camera follows him, and it's nice and smooth as per the smoothness variable I set.

The problem is when I turn the character to a diagonal angle (or, in fact, any angle that isn't 0, 90, 180 or 270), and then move the character, the camera gets all jittery on its Y axis. I've tried all sorts of things with the code that I can think of, disabling aesthetic code like the animation, removing the skysphere etc. I've tried fudging it out by scaling everything up, and while that seems to minimalise the problem, it's still noticeable. I've reordered the code to see if that would help. I've tried my best, and I just can't shake this problem. The character moves diagonally ok, but it seems like the camera is sort of 'staircasing' between variables.

I feel like I've tried everything I can think of, and I made sure to before bothering anyone on these boards. I'm reluctantly asking for help now, please.

Here's my system specifications...

Windows XP Home Edition with SP2
3.4 ghz Pentium 4
1 gb DDR RAM
200 gb HDD
Geforce 5700 LE with 128 mb onboard memory

And my code...



Thank you for your time.

Who wants cake? I've got a little slice of hell for everyone.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th May 2006 18:29
Camera positions can be fractional numbers like 1.2, 5.687, etc.

You have forced integer values by using variables like PlayerX

These can only hold whole numbers like 1,2, 56, etc

That is why things are jerky.

You have a choice;

either use variables with a # on end, ie PlayerX# which lets that variable hold fractional values.

or define PlayerX to be a fractional variable using;

PlayerX AS Float

For further info on datatypes, go into help in your editor, select 'principles' then 'datatypes and variables'

Boo!
Mirthin
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Land of the Rising Haggis
Posted: 8th May 2006 18:57
You've fixed my problem, and in record time too!

Thanks a lot spooky. You're going in the credits!

Who wants cake? I've got a little slice of hell for everyone.

Login to post a reply

Server time is: 2024-09-24 23:24:50
Your offset time is: 2024-09-24 23:24:50