How to make speed indicator??

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
KAHIMA
Posts: 19
Joined: Sun Mar 01, 2009 7:44 am

How to make speed indicator??

Post by KAHIMA »

I want to make speed indicator in my programs, but i dont know how to create it?? What class or code that i should use ?? Thanks before
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

What do you mean with speed indicator? A speedometer? Or a blur effect when something moves? Or something completely different ?
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
KAHIMA
Posts: 19
Joined: Sun Mar 01, 2009 7:44 am

Post by KAHIMA »

Yups... i want to make speedometer... How can i create it??
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

You have to make one yourself.
You could use a simple texture as a background and draw a line from the center to the edge in a certain angle that depends on the speed.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
KAHIMA
Posts: 19
Joined: Sun Mar 01, 2009 7:44 am

Post by KAHIMA »

I already made the picture,,what should I do next??
How does I make it??
I don't have any idea how to make it...
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

You can use sine and cosine to get coordinates on a circle for a certain angle.
With that you draw a line ( for example using IVideoDriver::draw2DLine() ) from the center of the texture to the position you calculated.

For the angle you have to devide the circle into steps ( for example 1 degree for 1 mph would mean that the speedometer ranges from 0 to ~180 mph )
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Post Reply