I have to animate an object to go from point A to point B. the path between A and B is set to a curve.
I propose three solutions:
-encode the trajectory control of translations by putting the maximum point for smoother movement
Create a curve in Blender and export in JME and follow the curve
Create a 3D object in Blender as a road or object “follow the object”
I do not know which way to go even though the second seems to me better, if there is no other solution I agree.
In tt case can you tell me a little I’m a beginner.
What is for example possible, is to name on of the rails, (i use the right in this case) and name it special in blender
Then when loading a track, scan trough the graph for the right rail’s, and generate motionpoint out of them and connect them. Now you know where you want your right wheel(is it called that for a train?) can be, now get your current position, the speed of the train and move it along this path. (Recalcualting where the rest of the train should be from the information where the right wheel is.
I work on many part of my project and I progress on subjects according to priorities, hence I come back only now.
I want advance in this part.
Now i work with cubes on a path (with MotionPath and waypoints like TestMotionPath.java), until now it was good for my test but now i must to be able to put cube in place precisely on a path and this place may be between two waypoint.
is it possible to do that with MotionPath and waypoints?
So Empire Phoenix you said : " Then when loading a track, scan trough the graph for the right rail’s, and generate motionpoint out of them and connect them."
What do you meen with “and generate motionpoint” ?
a motion point is just a point in 3d space, its a vector3f. each vector3f that you add to the motion path is a “motionpoint” (actually i think theyre called waypoints, but close 'nuff)
whatever spatial youre using with the motionpath will go to each waypoint.
if you want to set the object in a “future” position of the motionpath, you can use setTime()
so for example, lets say we were using the motionpath example code which has a path with an initial duration of 10 seconds, and you wanted the object to be at a point 25% along the way of its route, then you can do motionControl.setTime(2.5f). It’ll move that object to that point in time on the pathway, then you can do motionControl.play() to play the path starting from that point in time.