Sign in to follow this  
Frank Montanaro

Newbie, First Post

Recommended Posts

Wasn't sure whether to post this in OpenGL or here, but I opted for beginner since that is what I am. I recently started messing around with OpenGL and have done some basic tutorials about very basic things. I was messing around with the polygons though and had some questions. Do I have to create every vertex in a specific order in order to enclose the shape correctly? Is there another way to create vertices other than specifically specifying(redundant :p?) them for objects I am trying to model that aren't akin to basic algorithms? For example I am trying to model an Interceptor from Tron, because I figured "hey, its consisting of pretty basic shapes, shouldn't be too hard!" but I find having alot more trouble than I imagined. My main problem is just figuring out exactly what coordinates to put. I am probably going about this incorrectly, I have NO prior graphics programming experience and have pretty much just programmed in Java, so my background isn't the best =/ I have a book and the internet, yet I can't find any simple polygon tutorials to create objects, they all just lead to using cubes, triangles, etc. Any help would be greatly appreciated, maybe some of your favorite ABSOLUTE beginner links, tips on how you go about modeling things, etc. Thanks, Frank

Share this post


Link to post
Share on other sites
Welcome Frank. Change the topic of your post, or there's a good bet no one who you're really looking for to answer your question will even look at this, since it sounds like a "Hi! My name is..." thread.

Share this post


Link to post
Share on other sites
Hey Frank.
I don't think that there is any easy way to hard code a 3D model.
Most likely you would want to use a 3D graphics library, and then create the 3D model in a 3D editor (like Blender or 3D Studio Max).
Otherwise you could write a simple file loader (for wavefront (.obj) thats rather easy), and again create the 3D model in a 3D editor.

If you insist on hard coding the model, You should draw it on a paper from different sites. In that way it'll be far easier to code.
Once you've drawn the model on paper, you should draw every surface as a polygon (rectangle or triangle (depending on what suits you best))

Good luck :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Frank Montanaro
For example I am trying to model an Interceptor from Tron, because I figured "hey, its consisting of pretty basic shapes, shouldn't be too hard!" but I find having alot more trouble than I imagined. My main problem is just figuring out exactly what coordinates to put.
I am probably going about this incorrectly, I have NO prior graphics programming experience and have pretty much just programmed in Java, so my background isn't the best =/


The general course of action would be to model the Interceptor in a 3d modeling program such as: Blender, MilkShape, 3dsmax, Maya, etc... and then load the model data in your program and pass that data to OpenGL.

Actually modeling something via OpenGL is doable, but it is terribly inefficient and much harder once the model begins to get complex. For an example of model loading, take a look at this tutorial from NeHe. Here's a tutorial on a 3ds loader and MS3D loader as well.

All you have do is model your object in the 3d program, export it in a data format that you have code to load it as, and then use the appropriate loading code in your program to get the data to OpenGL and you are done. I'd start simple and do something like a box first and then try to get the process down of using the modelers and loading a simple model into your program before trying to design something complex. Good luck!

[Edit]Slightly slower than VildNinja >.>

Share this post


Link to post
Share on other sites
Generally speaking modelling is done using a 3D modelling package (Maya for example), in order to get these models into your application you write a model loader that can interpret the file format for the 3D model.
Alternatively, if a model is procedural then it may be generated by an algorithm.
Hard coding models is fine for simple primitives like cubes but isn't practical when you start talking about larger scale applications like games.

Share this post


Link to post
Share on other sites
Ah okay, thanks for all the replies. I figured you might be able to load some stuff, but like you said you need to write a loader, and I'm just getting started on this.
OpenGL is a bit scary for me, haven't done geometry since like Freshmen year of high school and my linear algebra is a bit rusty.

I'll look into those modeling programs, that is primarily what I am interested in learning to do. Although I also have a really strong interest in starting to learn game creating and OpenGL is the only course I could find right away at my school so I am pretty much forced to learn that.

My partner and I ended up just modeling something a BIT more similar, thought I think I am starting to get the hang of drawing/transforming/displaying the stuff to form scenes.

I hope one assignment will be to program a loader, so that could kill 2 birds with one stone.

How about books/sites/resources/etc. for the absolute beginner in any kind of graphics api? I find having alot of examples is how I am able to really learn things.

Thanks for the replies again

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this