Advertisement

Improving smoothness of rotations

Started by February 15, 2000 10:18 PM
10 comments, last by paulcoz 24 years, 11 months ago
My engine is working quite well - I can move the player backwards/forwards and left/right, and objects in the world move around the player really REALLY smoothly - I want you to know that this baby is smooth as, so there can''t be too many instructions in my code at this point. BUT...when I rotate the camera the objects moves around the player as they should but two things happen: (1) they either rotate in big jumps (when programmed to rotate 1 degree at a time) (2) they rotate smoothly around the player but move far too slow (when programmed to rotate 0.1 degrees at a time) I really want to be able to move smoothly but also quite fast (eg. it has to be at least 1 degree at a time). I am using the UVN vector system (See Programming/3d theory/viewing systems for 3d engine) so the rotations are not adding any additional multiplies/calculations to the rendering process (the same no. of calculations are performed just with different values for roll, pitch, and yaw applied to the uvn unit vectors). Does anybody know how I can smooth the rotations out? Paulcoz.
Is the angle measured in degrees or radians?

Try adding .25 or .5 even
Advertisement
Hello Anonymous Poster,

The roll, pitch and yaw values are incremented/decremented by either 1 (objects jump rapidly across the screen) or 0.1 (objects move smoothly but way too slow).

These values are converted to Radians before I pass them to sin and cos.

Thanks,
Paulcoz.

Just to clarify, when I say jump rapidly I mean that the step from not being rotated at all to rotated 1 degree is a noticable jump on the screen - that is why smaller increments make the animation smoother.

It is not that the objects actually leap a huge number of world units per 1 degree, they just move far enough that the rotation is not smooth (eg. looks like crap) - if I try to compensate by making the increments smaller it smooths out the animation (due to the smaller steps) but takes ages to rotate 90 degrees or more.

Edited by - paulcoz on 2/15/00 11:50:47 PM
get a better cpu and/or video card. that''ll make it smoother. also, motion blur can make it smoother. otherwise, if your system cant update the object enough times to fill in the frames in a fast rotating object, it''ll be jerky.
Carl "trixter"[email=carl@trixoft.com]carl@trixoft.com[/email]http://www.trixoft.com
Perhaps your engine needs some tuning. What kind of fps are you getting? You should be using lookup tables for sin and cos values. That might speed things up greatly.
Mike Weldon, a.k.a. FalloutBoymweldon@san.rr.com
Trixter,

I doubt it''s my CPU / video card I''m running a PIII 450 with a Voodoo2 SLI, besides, if I try the rotation in Quake 2 the animation is super smooth and doesn''t jitter at all.

Before you jump to conclusions and say my code is poor I did mention that everything works really smooth just moving back and forth didn''t I? Because of the vector system my program doesn''t do any additional calculations during the rotations.

My engine definitely needs some tuning, however I am sure it is not the program code but the process I am using.

Any more ideas?
Paulcoz.

Advertisement
But, you didn't answer my question about fps. At 30 fps and 1 degree increments, it will take 12 seconds to do a full rotation. If you want it to rotate faster you have to either increase your frame rate somehow or increase the rotation increment. There's is really no other way. If you haven't implemented an fps display yet, time to do it now. You will need it.


Edited by - FalloutBoy on 2/17/00 2:13:44 PM
Mike Weldon, a.k.a. FalloutBoymweldon@san.rr.com
Hi FalloutBoy,

My fps counter jumps around a bit, alternates between 35, 14, 75, 80 and 200 each frame.

Paulcoz.
Hi paulcoz

Do you use Quaternion to interpolate beetween the rotations
you want.If you don''t , I think you should.It would allow you to change the smoothness factor in real time

MindBreaKer
jabnou_o@epita.fr
MindBreaKer jabnou_o@epita.fr
Hi Paulcoz


I was having problems with jerky rotations. I am using a
particular graphics engine. My frame rate would go low if
I hit a high face count textured object and go high for
a low face count object. Since I am using this graphics engine, it has a build in tick counter function which allows me to regulate my frame rate like 60 fps or higher. After I multiplied all my movements by a multiplier value thats returned by the tick count function , all my rotation and movements become smooth.

Doug

This topic is closed to new replies.

Advertisement