Need help. I'm a newb here.

Started by
9 comments, last by Axesor 18 years, 4 months ago
Hello. I have been in C++ for quite some time. I always wanted to do 3-D games. Maybe one day make a clone of StarWars. Anyway, I started small. I made some blocks colored them and got him walking in a white void. My problem is this: I can't get the guy to rotate and and go in that direction that he is positioned in. What is a Camera? I hear about it alot and I don't know what it is and how to use it. After a few steps of the guy walking, I want the view to follow him. How do you make spheres? How do you get shapes to have textures? If you answer any of these questions, Thank You. ~Axesor
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward
Advertisement
If you go through the tutorials at NeHe you will find the answer to all of your questions and then some!
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
Quote:Original post by Axesor
Hello. I have been in C++ for quite some time. I always wanted to do 3-D games. Maybe one day make a clone of StarWars. Anyway, I started small. I made some blocks colored them and got him walking in a white void. My problem is this:
I can't get the guy to rotate and and go in that direction that he is positioned in. What is a Camera? I hear about it alot and I don't know what it is and how to use it. After a few steps of the guy walking, I want the view to follow him. How do you make spheres? How do you get shapes to have textures?


If you answer any of these questions, Thank You.

~Axesor


Well if you been working with C++ for sometime now you are going to have to do the same with OpenGL for there is a lot of information to learn with OpenGL. Have you looked at NeHe's tutorials? The sphere is all math based calculations and you can either do it in immediate mode or send it as VA, VBO's. The camera is very important due to you need to understand how to use it to point it at the scene. I recommend following some of NeHe's tutorials or buying "OpenGL Game Programming" book by Kevin and Dave the staff here at gamedev. The book is a great place for you to start learning OpenGL. As for textures you will need to use or code your own texture loader and then upload them as texture objects.
I have. I can't find anything about pheres or moving stuff in a 360 rotation rather than view.
~ About the book. I will try but I don't know. I'll look into NeHe's stuff.
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward
The camera is the viewer. It represents the person setting at the computer. The near plane represents the screen. A projection is done by finding the intersection of a line from the camera to the vertex with the near plane. That's done using similar triangles, i.e. if all the interior angles of two triangles are the same then the ratio's of corresponding sides are the same.
Keys to success: Ability, ambition and opportunity.
A camera is basically a viewpoint. A 1st person camera is where there's no visible model in front of the camera that you can control, instead, you are the character. If you've played a first-person shooter then you'll understand this concept. A third-person camera is one that follows a model around. The camera (viewpoint) stays behind the model and can usually be spun around the model (character) and zoomed in/out. Most MMORPG's use a 3rd person camera as their default camera.

Excellent OpenGL sphere tutorial.

Best of luck!
Spheres: either you use the OpenGL Utility (glu) library function gluSphere, or else you have to build spheres "by hand" (means to create yourself faces, either triangles or quadrangles, that form a sphere).

Rotation: Use glRotate function to perform a rotation. However, you may be surprised if the function does not exactly what you wants. You have to be aware that the net transformation is sensitive to the order of the particular transformations it is build from.

Texturing: There is definitely a tutorial on texturing in NeHe.

Camera: Ups, LilBudyWizer has already answered.

3rd person cam: That is a little bit tricky. Look this threads:
http://www.gamedev.net/community/forums/topic.asp?topic_id=359381
http://www.gamedev.net/community/forums/topic.asp?topic_id=359642
(especially my answers ;-)

BTW: However, I would suggest you to make smaller steps. The 3D stuff is a very wide field, and some caveats are waiting for you. Do the basics right, and you'll succeed.
Thank you all. Where did you start out in OpenGL?
But back to the topic, I understand the view points. It's glRotatef, glTranslatef, and my DrawModel(GLfloat x, GLfloat y, Glfloatz) that I'm having a tough time with. I can't seem to get it to move right. But I'll look into this =)
Once again, Thank You.
~Axesor
.::WARNING!::. Axesor is a total newb or n00b! Beware his lack ofintellegence of OpenGL. Feel sorry for him and keep him in your thoughts.~Leader of the phsychoward
Quote:computer says no

If only you knew how funny that was... Little Britain!

Anyways, ignore that slightly random comment, you'll probably only understand it if you're from the UK.

I started with NeHe's tutorials actually. I read them through 2/3 times so that I understood it and then I would create a blank project and try to code it off by heart. If I made a couple of errors I look back at the tutorial and corrected them.
Quote:Original post by Anonymous Poster
Quote:computer says no

If only you knew how funny that was... Little Britain!

Anyways, ignore that slightly random comment, you'll probably only understand it if you're from the UK.

I started with NeHe's tutorials actually. I read them through 2/3 times so that I understood it and then I would create a blank project and try to code it off by heart. If I made a couple of errors I look back at the tutorial and corrected them.


personally i prefer not to do that. i prefer to take a tutorial, get it working and then go through it and find out what it does, piece by piece.

learning off all those function names before you've ever used them... ugh

This topic is closed to new replies.

Advertisement