beg for a 2D racing game physical model .Thank very very much!

Started by
5 comments, last by zy_ai 16 years, 5 months ago
The all my friends who love game codeing! I want to make a simple racing game physical model which is 3D transform to 2D. Hoping everyone can help me, give me some data or method.Thank very much! I only need to solve an observation to order to rise and fall with road, turn right or left, and the relation of of distance background. .For example race car go down slope observe to order to also follow a change, distance background ascension, road side long etc.. Hoping each friend can help me once.Thank very very much!
Advertisement
If you browsed around for a minute you might find this little tutorial. All it needs in your case is a Matrix object, a 3d Vector, 3d integration, some type of ray cast, a suspension model, and a friction model. Other than those things its a proper vehicle simulation.

I plan on expanding the tutorial to include those things eventually. I mean I already have the demo, I just don't feel like typing up another 10 pages of info yet. Also, the 3d one is much more complex.
thank you to bzroom very much!!

your article help me very much. but now i first need to show a twist road which can turn right , turn left ,downgrade or upgrade .
please, can you learn me somethink like that. thank you again!
I'm not sure what kind of road you want.. is this a top down 2d game? or a 3d game? I'd most likely, in either case, suggest some sort of spline. You'd setup points along some curve, and then using interpolation you'd compute the curve at a given interval. Then you compute the tangent (the slope of the curve), then you cross this with the road's normal (also likely some kind of curve). Expand this cross direction in both directions to get the sides of the road. Accumulate these and make a quad strip. Use these for drawing and collision detection.

Here is an illustration.
Photo Sharing and Video Hosting at Photobucket

Look up Bezier curves. Now keep in mind when you see a curve illustration in their explanation. This is *per* component, so in the case of a 2d vector, you'll have 2 curves, the first curve's graph's independent axis is the interpolation value along the curve, the dependent axis is the X value of the 2d curve. Like wise for the Y component, the independent curve graph axis is the interpolation value, and the dependent axis is the Y component. You'll need 2 sets of curves, one for the road position and one for the road's up axis (the road normal.) If these 2 curve sets follow each other exactly the road will always face up. If you make the road normal curve vary independently of the position curve, you'll create banking and such.

If you have access to a modelling program such as 3ds max, take a look at "lofting" this exactly the same process.

From our very own knowledge bank: Bezier Curves and Surfaces
Thank you! That approach my need! I need to make a 2D TV racing game. just like Top Gear 2 or Mario Cart etc. using SFC Platform . My visual angle is behind cart , so it look like 3d.
I don't kown how to find the data number about twist load's excursion, includ downgrade or upgrade (undulation).

just like these pic.

http://img.photo.163.com/3nVIxKWF3ZKBLtXgLG3Ttw==/713539065962047885.jpg

http://img.photo.163.com/RYVNpX0f0gRwIbAAgdLJ_A==/691302542802146975.jpg

You are so fervor! Thank you! Can i contact with you using MSN or Email etc.?

I've given you a method for simulating the vehicle physics. How you interpret this to be displayed in "mode 7" I do not know. I have no experience with these type of graphics. Good luck!
Thank you! bzroom.
You have help me very much! I will learn that.

This topic is closed to new replies.

Advertisement