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

rolling sphere

Started by Athos84 Dec 10, 2008 at 9:44 AM 8 replies 950+ views
Original Post
Athos84
Athos84
hi all! My OpenGL scene describes a simple plane with a sphere on the top of it. When I incline that plane, the sphere must roll along the right direction (and, if necessary, fall down from the plane), but I have no idea about the right way to develop this feature. can you help me? any hint will be appreciated :)
swiftcoder
swiftcoder
This is a question of physics, and has very little to do with OpenGL. The simple solution is to integrate a pre-built physics solution (such as Bullet), as friction, etc. for rolling objects is a lot more complex than it sounds.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Athos84
Athos84
Quote:
Original post by swiftcoder
This is a question of physics, and has very little to do with OpenGL.


I'm sorry. I didn't know that :(
If you know Bullet, can I ask you something about it?
CableGuy
CableGuy
If all you need is a sphere rolling on a plane, integrating and learning a whole new physics library might be a bit overkill. I'm sure you can Google and find plenty of information regarding this problem.

HTH.
Athos84
Athos84
I Googled before to open a new thread ;)
can you paste here (or send as PM) a few links related to my problem?
thanks a lot!
Athos84
Athos84
i'm still here :)

in this forum I found a discussion about a rolling sphere, but I was not able to understand if that topic could help me :'(

link: http://www.gamedev.net/community/forums/topic.asp?topic_id=4812

it explains something about quaternions.
Zakwayda
Zakwayda
Is this a homework assignment? If so, what have you been able to figure out so far? How much do you know about programming? What about graphics? Is it just the physics simulation part you're stuck on, or are there other parts of the project that you're having trouble with?
Athos84
Athos84
no homework
ok programming
ok opengl
no physics

I'm developing a demo software. Currently I render a sphere and a plane (starting from NeHe lesson 26), but obviously the spere is only a draw. No interaction is present. I need something like the "force of gravity"...

Final result will be a plane inclined by arrows or mouse or else, and the sphere will be "in equilibrium" (sorry for my english...), rolling over the plane without falling down
Zakwayda
Zakwayda
You might see if you can get a mod to move this thread to 'Math & Physics', since it doesn't have anything to do with OpenGL. You'd probably get more help there.

As has been noted though, doing this 'correctly' is a non-trivial problem. As such, the easiest solution would probably be to use a pre-existing physics engine (as suggested previously). Or depending on how physically correct the simulation is expected to be, you could probably throw together an ad hoc solution using very basic physics and vector math.
Athos84
Athos84
thanks a lot :)

@Brother Bob:can you move this thread to 'Math & Physics' forum please?

Topic Locked

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

Sign in to reply to this topic.