Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Creating a Movement Path

totenkopf
Registered User
Quote
2013-04-25 21:25:37

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 :)


niko
Moderator
Quote
2013-04-26 06:52:34

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();
path.Nodes.push(new CL3D.Vect3d(0,0,0));



totenkopf
Registered User
Quote
2013-04-26 15:00:18

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

?


niko
Moderator
Quote
2013-05-03 06:10:59

Hm, that's currently not possible, you would have to write this yourself.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact