Advertisement Jump to content
Sign in to follow this  
Checkmate_001

First Game: Distance and Velocity

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

Hi,

 

I was wondering How I would represent distance and velocity very simply for my first game.
I needed to have a system for distances to accurately model projectiles.

 

Should I have (1, 0, 0) = 1 meter from the origin? Or is there a system/ systems that people usually use?

 

And once I have decided how to model the distance, How would I change my models to fit this?

Could I specify the y co-ordinates, in a program like Blender, to scale the model accurately?
Or would I have to scale it in code?

 

Thanks In Advanced,

Checkmate_001

Share this post


Link to post
Share on other sites
Advertisement

Hello.

 

Your question is very general and quite confusing.

 

You'll sooner or later need to know at least basics of vectors and kinematics (plus dynamics if you'll need gravity and/or forces).

 

And as far as scale is concerned - that all depends on you. In most cases you can use the natual real-life units, so if you were modeling let's say human beings, they could be around 1.8 "game units" large, where a game unit is a meter.

It really doesn't matter what distance-measuring float variables in your code represent, as far as it's uniform everywhere as you know the meaning. Using meters is the best, because that's the basic SI unit and kinematics/dynamics calculations will be the easiest (gravity acceleration is 9,8 m/s2 etc.).

About models - if possible, model them in Blender directly in the final scale. When you are making the models yourself anyway (or your 3D-models-guy is), why not to make them as large as you need right from the start? Otherwise you'd have to scale them, probably during import (initialisation phase of your game). But here you'd have to be a little bit careful and scale also normals. Or you can also model them in a different scale, if that's more comfortable in Blender, but then scale it before exporting it from Blender.

 

Sometimes you may consifer also different units, not meters. If you are making a space simulator and your objects are very large (even kilometers) or some game about ants or microbes which are very small, you would be dealing with numbers like 1000000.0f or 0.0000001f all the time, which could get troublesome.

 

Another concern - the coordinate system. You'll be using the Cartesian coordinates, either 2D or 3D. How are the axes oriented depends again only on yourself, you can choose it and then stick to it! There are two options: right-hander and left-handed system. The right-handed is usually oriented in 3D with the y-axis up, while the left-handed has the z-axis up. But this is not a rule, that only depends on your camera and world orientation! The important difference between those two systems is the order/direction of the x,y,z axes relatively to each other.

Edited by Tom KQT

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!