Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi - It's me again :D So after solving my problems with animated characters, I'm working on a path system. I tried to write my own movement system, but this one works to slow, so I want to test it with the Copperlicht-functions. Here's my problem. So I have a function with setInterval and this function gives me some variables each second. I have: - Next X, Next Y, Next Z - Values - Movement time to these Values. - Object ID Because the Object could have multiple movements in 1 second, I can't use AnimatorFlyStraight und have to use AnimatorFollowPath. But I don't get how i can create and use paths. So I have 11 Variables. - X,Y,Z Now - X,Y,Z, movement time (next 1) - X,Y,Z, movement time (next 2) How can I create a path out of these Javascript variables and how can I say an Object to follow these path. Something like this: play = scene.getSceneNodeFromName('Player'); play.setPathToFollow(path); ? If this works, how can I convert my variables into "path"? I know, this might be a very basic question, but I hope you can give me a little code example. Thanks a lot, Totenkopf :) |
||||
|
You could just create a path scene node (CL3D.PathSceneNode) and manually set its positions. That scene node has a member named 'Nodes', which is an array of vector3ds. So you could simply change that: path.Nodes = new Array(); |
||||
|
Okay, thats how I create the path. But How do I assign the movement time between two notes? So if i have 4 nodes in 1 sec, i want this: 0->1: 0.2 sec 1->2: 0.1 sec 2->3: 0.6 sec 3->4: 0.1 sec instead something like this: 0->1: 0.25 sec 1->2: 0.25 sec 2->3: 0.25 sec 3->4: 0.25 sec ? |
||||
|
Hm, that's currently not possible, you would have to write this yourself. |
|