Skip to main content
GameDev.net gamedev.net
🔒 Locked

strange problem

Started by trust Apr 23, 2004 at 1:53 AM 2 replies 350+ views
Original Post
trust
trust
Hi everybody! I''m creating a virtual billiard game. For this game, I use ODE and GLUT. I don''t know if you''ve heard of ODE, anyway it''s not important, because I don''t think the problem comes from it. I have this ball, rolling at a constant velocity: (velX, velY, velZ) In order to stop it, I apply on it a force whose values are opposed to the velocity: force(-velX*0.1, -velY*0.1, -velZ*0.1) This should slow down the ball. But when I read continuously the values of the velocity, it never slows down. But the force is here, I can read its values. Anyway, when I start clicking on the "render" window, magically, the ball starts slowing down. I''ve never seen such a thing. Any Idea? trust
trust -- some girls also like openGL
Chupacabra
Chupacabra
Is the function where you apply the force to the ball in the glutIdleFunc? If not, put it there.
trust
trust
Yes, it already is!
I really don''t know where this problem comes from!

trust
trust -- some girls also like openGL
Puzzler183
Puzzler183
Well, your function is exponential and friction results in a constant deceleration proportional to the normal force. But that''s not the problem. Try putting the deceleration in your rendering function (based on time of course).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.