Hey guys,
I wanted to make an RTS Game, but It also should have an ability to show the player where his space ships are in a few minutes and which route they will follow.
The best way is IMO to draw a line from a function.
For Example:
(This Example is 2D because it’s easier to explain… The final result should work in 3D too)
So in this image we have a small solarsystem.
There are 2 Planets on the coordinates (-431|254|0) and (-564|415|0).
At first I want to draw 2 circles which are representing the route of the planets.
The function should look like this “DrawCircle(int xSize, int ySize, int thickness, Vector3 Position);”
And now I want to draw the route the spaceship will fly from on of the planets to the other. So I’ll calculate the formula.
But I don’t want it to go through the whole place so I can also say on which X it should start and on which X it should stop.
The function could look like this:
DrawFunction(int a, int b, int c, int x, xToStart, xToStop, thickness);
(a, b, c and x are the values of the formular… (f(x) = ax^2+bx+c))
So and now my question^^
Are there functions like this - and if not can someone give me a hint how to make them (Like drawLine(Vector3 start, Vector3 stop))
best regards deSpeach