Ugly Camera attached to Ball Movement Problem

Posted By: Ness

Ugly Camera attached to Ball Movement Problem - 10/18/09 15:31

huhu, I am going into the LITE-C Tutorial and i had the first FAIL in the first Physik Tutorial:

Click to reveal..
function main ()
{


level_load ("testrooma7.wmb");
fps_max = 140;
wait (15); // warte, bis das Level geladen ist
ball = ent_create ("ball.mdl", vector(0, 0, -256), NULL);
ent_create ("tetraeder.mdl", vector(40, 0, -256), NULL); // erstelle den Ball
ph_setgravity (vector(0, 0, -386)); // setze die Schwerkraft
phent_settype (ball, PH_RIGID, PH_SPHERE); // setze den Typus der Physik-Entity
phent_setmass (ball, 3, PH_SPHERE); // und ihre Masse
phent_setfriction (ball, 80); // setze die Reibung
phent_setdamping (ball, 40, 40); // setze die Dämpfung
phent_setelasticity (ball, 50, 20); // setze die Elastizität
while (1)
{
ball_speed.x = 25 * (key_cur - key_cul); // bewege d. Ball mithilfe d. Pfeiltasten
ball_speed.y = 25 * (key_cuu - key_cud); // 25 setzt die x- / y-Bewegungsgeschwindigkeiten
ball_speed.z = 0; // Bewegen auf der vertikalen Achse ist nicht nötig
phent_addtorqueglobal (ball, ball_speed); // füge d. Ball ein Drehmoment hinzu
camera.x = ball.x - 250; // halte d. Kamera 300 Quants hinter d. Ball
camera.y = ball.y; // verwende dasselbe y wie mit d. Ball
camera.z = -200; // und plaziere sie bei z = 1000 Quants
// camera.tilt = -90; // lasse sie nach unten schauen
wait (1);
}


}


Its the BALL Physik Movement and when i press the Key Arrows,the Camera starts to SHAKE very BADLY!
How can I get rid of this problem?
BIG THX to all who can help me laugh

MFG Ness
Posted By: alibaba

Re: Ugly Camera attached to Ball Movement Problem - 10/18/09 15:57

i see nothing that lets the camera shaking....
Posted By: Progger

Re: Ugly Camera attached to Ball Movement Problem - 10/18/09 16:35

fps_max = 140;
well i think that could be ur problem
check out how much fps ur pc has
do it when u load the script19
press F11 and then look left on fps
then change it to the fps u have maybe its the problem but i dont know.Try it and tell if it work laugh
Posted By: Ness

Re: Ugly Camera attached to Ball Movement Problem - 10/30/09 22:11

That has nothing to do with FPS! It has to do with actualization with the camera position and BALL position frown
Oh man...
Posted By: Superku

Re: Ugly Camera attached to Ball Movement Problem - 10/31/09 00:43

camera.x += (ball.x-250-camera.x)/2*time_step; // halte d. Kamera 300 Quants hinter d. Ball
camera.y += (ball.y-camera.y)/2*time_step; // verwende dasselbe y wie mit d. Ball
camera.z = -200; // und plaziere sie bei z = 1000 Quants
© 2024 lite-C Forums