Jump to content
  • Advertisement
Sign in to follow this  
harnacks

Thoughs on Game Engineering

This topic is 4788 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

I began with OpenGL about 6 months ago, and I've come a long way. I've been programming C++ for about 5 yrs now, and I've come even furher there. I've been making console games for a long time and I'm ready to give them a 3d face, my problem is I'm having trouble visualizing that concept. Let me explain myself. In a physics simulation, one mass is struck by another user controlled mass, and the resulting Vectors for direction, velocity, and acceleration are shown until both masses come to a rest. How do I take an instance of my Mass class... and use its Position vector to generate a 3d position, specifically.. how do I take hard coded vertex points of something like a cube out of a 3 point Mass-Position vector, considering the position is an x y and z, while the vertex list for a cube is 24 points, all with normals. I'm having trouble uderstanding the relationship between what is computed, and what is draw, and how opengl and the rest of my program can communicate.

Share this post


Link to post
Share on other sites
Advertisement
In short, how do I make physics for my game.

To correct but just one thing that you said, you do not have a mass class. All mass is, is a value. It defines the mass of an object.

Really, this is a subject that is a bit too big just to answer. [google] a few physics engines/simulations for an idea of how to implement physics into what you want to use it for.

Share this post


Link to post
Share on other sites
Take a look at ODE. It is an open source dyanimcs engine that does all this stuff. As rpg_code_master has said, it is really a big answer, so sorry I have nothing specific. I have used ODE though another wrapper and it does work realistically, it's just a matter of going though all the code and figuring out what's going on. Good luck!

On a side note, there are a lot of other smaller physics related engines that you should probabally take a look at first: OpCode, Open Dynamics Framework, and ColDet.

Share this post


Link to post
Share on other sites
hmm not sure i got you right here, but is this what your asking for:
how do you place a 3d object into the 3d world?
what you do is transform it with matrices;
a perspektive matrix, to get the object to render in "3d" and not just flat
a camera matrix, the cameras position change how the world looks dont it?
and a world matrix, and finaly the actual place in the world where the object is.
when you transform a mesh with a matrix, all of its vertexes is repositioned based on the matrix information.
there is a LOT on this subject on the net, just read some begginer tutorial on 3d transformation

Share this post


Link to post
Share on other sites
No no no, you guys got me all wrong. I'm saying once upon a time I had a console program that could do all kinds of things. I had an object that I could move, and would respond to forces applied and whatnot and so forth. How to I relate whats happening to that object to something in OpenGL..

Something like..

// in class.h somewhere..
Class Thing{}

Thing one, two, three;

//in openGl somewhere
Draw(){
Draw one, two, three, etc..
}


Thing knows its physics... it knows its own location, where its going, and where its been, at any moment it can deliver a vector stating its position. How do I give that to opengl in a useful manner... not specific code so much as just the idea behind it.

I'm not really interested in physics or opengl specifically right now, just the theory behind how they come together.



Share this post


Link to post
Share on other sites
My initial thoughts on the matter are this:

I create somewhere an array of pointers to objects of type "Mass" ( or some other arbitrary name, I dont litterally mean the constant 'mass'). This array is set to Null, until an object is created.
OpenGl renders every object in that list in a loop until the pointer is NULL.
Each object in the list has its own OpenGL description of what it is supposed to look like.

Is that a practical implementation ?

Share this post


Link to post
Share on other sites
Yes, although consider not worrying about all that null business and just iterate over standard containers instead. Update all objects in the list, render all objects in the list, rinse and repeat.

Share this post


Link to post
Share on other sites
Quote:
Original post by harnacks
I began with OpenGL about 6 months ago, and I've come a long way. I've been programming C++ for about 5 yrs now, and I've come even furher there. I've been making console games for a long time and I'm ready to give them a 3d face, my problem is I'm having trouble visualizing that concept. Let me explain myself.



By console games do you mean for systems like PS, Nintendo, etc...
Because if thats what you mean I'd like to know which system you made games for in the past 10 years which wasn't 3D?

Not saying you cannot, but the newer consoles especially are like Dx9, stripped of there 2D capabilities (like DirectDraw got stripped out). So any 2d game on these newer systems is done in 3D, just no depth (z=1)... Much like any Dx9 2D game will be done with vertices aligned to the screen.

Share this post


Link to post
Share on other sites
I meant console apps as opposed to windowed apps. Sorry

Thanks though I'm glad I cleared that up.

As I was browsing the forums, I noticed some people are trying to move away from the Glut... why is that ? Is it likely I could write a function faster than one already provied by opengl ?

Share this post


Link to post
Share on other sites
First and foremost: -- More graphic libaries = more support needed for video cards = no card would support all libraries = defeat the whole purpose of using a graphic library to generically communicate with any video card.

Some other points:
-- The more graphic libraries there are the more complicated video cards have to become, manufacturer's can impliment easily for Dx and OGL.
-- the more support provided to a particular library will strengthen it (faster/better/free); rather than everyone using something different thus we'd have competition in graphic libaries which is bad. Work together people :)
--Communities like this majorily use the OGL and DX which makes the progress game developers have much smoother and quicker since they can find info on anything related to those libraries.
-- No AAA game has used anything but Dx or OGL in years for PC games. (I cannot confirm this one)
-- There are less petty arguments between people on forums like these, example OGL vs DX has been discussed for the last 10 years.



Could you write something better... Well obviously anyone could eventually, if you dedicated as many people and as much time spent on Dx since its birth as they have you could easily compete with it. But you, yourself, there is no point, you as a game developer have better things to worry about; like making games :)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!