Game development Questions. LOTS!

Started by
5 comments, last by SteelBlue 22 years, 8 months ago
Ok, what i want to know is, how do you get to manipulate 3d models created in other modeling programs with OpenGL. Do you use OpenGL to do the animation of the models? What exactly does OpenGL do in a game environment? What can a game engine programmed in OpenGL do? Tha Funkalicious one
Tha Funkalicious one
Advertisement
Well that depends on the model you are using and what kind of models you want to load. Let me start with the bad news there is no "native" model format for opengl, that means opengl itself doesnt have functions to load and animate models, now those are the bad news. The good news are: they are several programs and examples to do this, check out this site:

nehe.gamedev.net

Specially the game programming tutorials are useful.

Now how to handle those models once they are loaded is a diferent history, but you can find help for that here.

http://www.wiz3domain.com/

Check out the tutorial making a fighting game in 7 days is probably the best tutorial on the subject.

however and just not to answer this question with a bunch of links, the process is something like this.

-You start opengl

-load the model data into an structure (you can use any model format you like, 3ds, msh, mdl, md3, etc) including textures, this structure must have a matrix as well.

(unless you want to use a -model -instance system like power render, which means you will be able to show the same model lots of times as diferent instances, in this case, your matrix must be in the instance instead) so you can store is orientation, scale and position.

-start the main rendering process.

-Whenever you want to render your model you should transform every vertex in your model structure by is model matrix also you should use its texture coordinates to render its textures as well. (simply bind the apropiate texture and render the model with textures on)

-Whenever a control key is pressed, a change in the model matrix must be made, per example the simple resident evil control set
left right rotate the model, up/down keys move the model forward, back wards. (you will need to move the model by its orientation vector)

-repeat until the escape or quit key has been pressed.

this may sound dificult, but since you will have functions, or objects members to do this, once you have them it may be as simple as.

model= new pmodel("ufo.3ds")

model.move (0,0,0);
model.rotate (0,35,0)
model.render

free model

cool uh? =)

start reading those links and check if you find answer to your questions (like vector orientatios) on gamedev article and resources, It will take a bit of time, but eventually you will manage to load and render models for some cool games.

Remember to help gamedev.net donate whatever you can to keep forums such as this up.

Hope that helps.



Well that depends on the model you are using and what kind of models you want to load. Let me start with the bad news there is no "native" model format for opengl, that means opengl itself doesnt have functions to load and animate models, now those are the bad news. The good news are: they are several programs and examples to do this, check out this site:

nehe.gamedev.net

Specially the game programming tutorials are useful.

Now how to handle those models once they are loaded is a diferent history, but you can find help for that here.

http://www.wiz3domain.com/

Check out the tutorial making a fighting game in 7 days is probably the best tutorial on the subject.

however and just not to answer this question with a bunch of links, the process is something like this.

-You start opengl

-load the model data into an structure (you can use any model format you like, 3ds, msh, mdl, md3, etc) including textures, this structure must have a matrix as well.

(unless you want to use a -model -instance system like power render, which means you will be able to show the same model lots of times as diferent instances, in this case, your matrix must be in the instance instead) so you can store is orientation, scale and position.

-start the main rendering process.

-Whenever you want to render your model you should transform every vertex in your model structure by is model matrix also you should use its texture coordinates to render its textures as well. (simply bind the apropiate texture and render the model with textures on)

-Whenever a control key is pressed, a change in the model matrix must be made, per example the simple resident evil control set
left right rotate the model, up/down keys move the model forward, back wards. (you will need to move the model by its orientation vector)

-repeat until the escape or quit key has been pressed.

this may sound dificult, but since you will have functions, or objects members to do this, once you have them it may be as simple as.

model= new pmodel("ufo.3ds")

model.move (0,0,0);
model.rotate (0,35,0)
model.render

free model

cool uh? =)

start reading those links and check if you find answer to your questions (like vector orientatios) on gamedev article and resources, It will take a bit of time, but eventually you will manage to load and render models for some cool games.

Remember to help gamedev.net donate whatever you can to keep forums such as this up.

Hope that helps.



Thanks man. That did help a bit. Just another thing, what books do you recommend i read to learn all that good stuff you just mentioned?

Tha Funkalicious one
Tha Funkalicious one
I would say the book of "playing-around-with-the-code-yourself"
You DIDNT READ THIS BOOK: "OpenGL Game Programming" by Kevin Hawkins and Dave Astle(GDNet owners!!)???? You better get it!

Its the best book around. By chapter 5 you are already making (lego looking) 3D models. It will answer tons of your questions. If you dont read it, then you dont succeed! lol. No, thats the best book to teach yourself, and its also a good reference.
Yeah, I''m getting that book next month, woho! :D

This topic is closed to new replies.

Advertisement