Jump to content
  • Advertisement
Sign in to follow this  
sasquach

OpenGL Bowling Pin

This topic is 4069 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok so here is my problem, I'm trying to create a bowling pin in opengl but I new at it. I understand how a sphere works and a bowling pin is kind of like a few spheres put together. If I start at the bottom of the pin it increase in diameter and then decrease then increase again and then decrease. What I'm having trouble with is writing the code to make that happen. Can someone help me? I know that if I use glutSolidSphere(radius, stacks, slices) this makes a simple ball.

Share this post


Link to post
Share on other sites
Advertisement
Generally for non-basic shapes you use a modeling program: Max, Maya, Blender, etc. That creates the model of the bowling pin (creates the vertices, the texture coordinates, the surface noramles) and saves it to a file. Then you simply have your openGL application read in that file and draw it to the screen.

-me

Share this post


Link to post
Share on other sites
Is there a special function call that needs to be made once I create the file in Max, Maya, etc? If so where is that done at?

Share this post


Link to post
Share on other sites
OpenGL has no built-in functions for loading models, that is all up to the programmer, so you'll have to write your own code to load the models, or find a library.

Share this post


Link to post
Share on other sites
Since I new at openGl could someone point me in the direction of a library that will work with 3d max?

Share this post


Link to post
Share on other sites
I don't think there are any libraries that load .3DS files. You can find the file format on wotsit.org and write your own loader.

Generally you just make a maxscript plugin to either export to your own custom model format or you can export to a commonly used format: md2, md3.... Google will reveal to you how to load those files. Should also be able find you a max exporter plugin (if not check out whatever fancy forums discreet offers you for having spend so much gold on their app).

I wrote a 3DS loader a while back but that code is buried somewhere mysterious (can't find it).

There's a tutorial on nehe.gamedev.net for loading blender files. If nothing else, it'll give you an idea of how it's done.

I'm assuming you're already comfortable working with binary files?

-me

Share this post


Link to post
Share on other sites
There is lib3ds, an open source project that can load most things found in thr 3ds file.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!