I am currently a senior in High School. I am probably going to major in something math/physics related (engineering). I am in 3 AP classes now, AP Physics, AP Calc, and AP Computer Science.
Of the 3, I am probably the best in physics. For the comp science project however, we have to enter a programming contest. I want to make a gravity simulation, in which objects with various masses interact with one another purely gravitationally. Hopefully, I'll be able to do a runtime simulation of the solar system.
I want to make the sim in 3D. Obviously, not to scale, as doing so would probably make everything too small to see. What is the easiest free 3D API for this type of thing? I also need to learn some theory about the 3D. All I want is very basic features, load textures, move camera, move objects, very basic lighting. What would you recommend to for me to use? OpenGL? DirectX? Something else?
The best book to learn from would probably be the Official OpenGL Programming Reference. Not sure if that's exactly what it's called or not, but it's red and has a 3d rendered image of a globe made from legos on the cover. It's a fairly atypical official reference in that it's useful and easy to follow.
Now for the theory part. Since you are in high school, some of it probably will be a stretch, because it's rooted in Linear Algebra, but you can probably learn the basics enough to get by. At the very least, you need to know enough to understand vectors and matricies. Especially related to normal vectors, as they are essential for lighting.
------------------
Despite the high cost of living, it remains popular.
1) What you're talking about is numerical approximation, and you'll find that if you run your simulator for too long (maybe a minute, maybe a few minutes), your solar system will "collapse" on you. The problem is in Euler's method of integration; it yields to error rather quickly.
2) If you use OpenGL or DirectX you will not have to worry about normals for lighting, etc, since that's usually handled by the lighting and transform engine of the API and/or hardware.
Originally posted by SilentStrike: I am currently a senior in High School. I am probably going to major in something math/physics related (engineering). I am in 3 AP classes now, AP Physics, AP Calc, and AP Computer Science.
Of the 3, I am probably the best in physics. For the comp science project however, we have to enter a programming contest. I want to make a gravity simulation, in which objects with various masses interact with one another purely gravitationally. Hopefully, I'll be able to do a runtime simulation of the solar system.
I want to make the sim in 3D. Obviously, not to scale, as doing so would probably make everything too small to see. What is the easiest free 3D API for this type of thing? I also need to learn some theory about the 3D. All I want is very basic features, load textures, move camera, move objects, very basic lighting. What would you recommend to for me to use? OpenGL? DirectX? Something else?
Any input would be appreciated.
------------------
Athlon 500@700 w/stock cooling
400 W ATX PS
Matrox G400 32 MB Dual Head
512 MB CAS2 PC 133 (Infineon)
120 GB RAID array + 27 GB main drive (loaded with mp3s, divx movies, etc)
8x DVD Drive
8x CD Burner
19" Monitor
Intellimouse Explorer and Cordless Logitech Keyboard
'93 Acura Integra--soon to be replaced with a 2002 Honda S2000 (HELL YEAH!)
Yeah, thanks Homer. I figured as much as #1. After I get it the code written, I can make the ticks smaller and smaller, to keep accuracy, but make the program run longer. It will probably be something like if I ran the program for X simulated time with a decent accuracy, it would take me T ticks of real time. If I were to run it for 2X simulated with that same decent accuracy, it would probaby take me 4T ticks of real time.
As for #2, have you done any 3D work with either API, or both? Which is easier to learn? It's good that I don't have to know the theory behind it, because that could be a bit abstract.
OpenGL is definitly what you should use. DX is a mess and is hard to start with as a newbie. OpenGL is very simple, but still very powerful.
However, unlike Homer Simpsson said you need to provide the API with the normals, as the normal/vertex and light color/position and attenuation factors are the parameters needed to calculate the lightings. However, normals are easy to calculate.
Also, I recommend the book OpenGL SuperBible. It's perfect for a newbie, but doesn't cover any advanced rendering techniques.
Originally posted by Humus: OpenGL is definitly what you should use. DX is a mess and is hard to start with as a newbie. OpenGL is very simple, but still very powerful.
However, unlike Homer Simpsson said you need to provide the API with the normals, as the normal/vertex and light color/position and attenuation factors are the parameters needed to calculate the lightings. However, normals are easy to calculate.
Also, I recommend the book OpenGL SuperBible. It's perfect for a newbie, but doesn't cover any advanced rendering techniques.
If you use a sphere generation function it will auto generate normals. I've done extensive work in OpenGL (I wrote a primarily NURBS based 3D modeler) and some work in DX7 recently (hierarchical modeling system with support for lots of texture/light models).
if you want to model planets, I suggest you use the glut library to generate spheres and just texture them with general planety-looking textures. OpenGL is powerful (not as powerful as DX8 for new hardware, as it does not support bump mapping, etc), and easy to use. I recommend using the glut library to get a general framework.
------------------
Athlon 500@700 w/stock cooling
400 W ATX PS
Matrox G400 32 MB Dual Head
512 MB CAS2 PC 133 (Infineon)
120 GB RAID array + 27 GB main drive (loaded with mp3s, divx movies, etc)
8x DVD Drive
8x CD Burner
19" Monitor
Intellimouse Explorer and Cordless Logitech Keyboard
'93 Acura Integra--soon to be replaced with a 2002 Honda S2000 (HELL YEAH!)
I can't find any GLUT tutorials. I started reading some of the OpenGL superbible and even modified the code so that I could move the rectangle and increase it's size from keyboard input . Then it basically said, go learn a bit about the Win32 API, then continue reading this. So I stopped.
Bookmarks