Racing Game-Please Help Me :)

Started by
14 comments, last by Jouei 17 years ago
Quote:Original post by KaKaroTo
Thanks for the model. :) :) :)
I took Nehe's routine for creating an OpenGL window and combined it
with a 3ds loader.
The program displayed the model but not properly.
I'm working with Visual studio 2003 .NET, I've Uploaded the program:

http://www.badongo.com/file/2573951

Please Take a look I'm sure it's something simple


I downloaded your program and there doesn't seem to be a problem with the display - there's just a problem with how you set the scene ;)
I had to set the far clipping plane to a value of around 30000 to see the whole model. As such, you might consider to both increase the far clipping plane distance a bit and to scale the model down a bit because a far plane distance of 30000 shouldn't be necessary for that racing track, I think...

If you add these two lines to your drawing function:
glScalef(0.01f, 0.01f, 0.01f );glTranslatef( 0.0f, -1000.0f, 50.0f );
and change the gluPerspective call in your scene resize function to:
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);

then things are already starting to look a lot better ;)


Advertisement
I tried running your code...

error C2065: 'i': undeclared identifier


On line 1134 of model_3ds.cpp.

I've looked up through your code and there's 'i' getting used here there and everywhere, so I don't want to go changing things. Am I missing something to get this to compile?

Other than that, I'm just getting warnings about deprecated functions, but I'm not terribly bothered about those TBH.
Rogierpennink you've helped me a lot. Thanks man.
I've added a camera and another 3ds model of a car.

How can i make the car drive on the track?
I've been told i got to do collision check...
Quote:Original post by ukdeveloper
I tried running your code...

error C2065: 'i': undeclared identifier


On line 1134 of model_3ds.cpp.

I've looked up through your code and there's 'i' getting used here there and everywhere, so I don't want to go changing things. Am I missing something to get this to compile?

Without actually checking the source, I'd wager that has to do with the "Force Conformance in for Loop Scope" option present in VS.NET. If the OP doesn't have it checked, then declaring an int (i) in one for loop will allow it to carry over to others without having to redeclare it. Naturally, that's pretty bad practice, and should be fixed. To whom it may concern (the author of "model_3ds.cpp" isn't clear): simply adding an "int" at the beginning of each loop should do the trick.
I've loaded a 3ds model of a car and a race track.
I don't know how to make the car drive on the model?

here is my project:
http://www.badongo.com/file/2615588

The right edge of the race track is higher than the left edge so when i turn the car to the right side the car is swallowed by the map.
If im not mistaken NeHe has a pritty good tutroaisl on collision detection
i havent programed in openGL for awhile now since i do directX however for the
most part id imagin it would be to hard have it check to see if the the car has collided with the road for the most part and i may not be correct on this part however if the road itself is a single model itself check to see if the car collideds with that and if it does then check for user input whatever the gas button would be aka is pressed. then move the car

for the most part if i were to do it id have differnt models for walls and the road and trees so on and so forth

if it hits a wall when the user trys to go say left apply the oposit direction to the car after the collsion that should stop it from being swallowed by the map.

for the most part if you a begginer and i know this from experince of trying to make games for a while now you want to make something 3d but mabye starting good and 2d might be a good idea!

as its abit easyer to handle all of the things you have to keep track of

i hope something i have sead helps :)

This topic is closed to new replies.

Advertisement