Jump to content

Ive got a Transform Riddle for you.


Pryme8
 Share

Recommended Posts

Ok take this case and scenario.

I have some sort of path its length and shape is irrelevant, but it at last has two points, a start and an end.
Now I want to take an object, and with and array in the form of
keys = [{value,time,easing},{value,time, easing},{value,time, easing} ];
then call it with something like:
var followPath = new Object.followPath(keys, args);
followPath.start();

Any takers?

Link to comment
Share on other sites

I think ive figured it out, the one thing I need to solve is how would I return the position of a point on a line by percent of the line?

ok... kinda got it structured the way I want... now I got a weird bug.
http://www.babylonjs-playground.com/#AGOCE#0
when I set the spheres position it flattens it and makes the mesh a circle? huh?

Nevermind it was because the y was nan.

Now the question is why is it not starting from the start point that I am passing to it?

http://www.babylonjs-playground.com/#AGOCE#1
if I comment out the lerp then its where its supposed to be.

http://www.babylonjs-playground.com/#AGOCE#2

I dont quite understand why its teleporting back to 0,0,0

Link to comment
Share on other sites

http://www.babylonjs-playground.com/#AGOCE#3
So removing the multiplication of the percent stopped it from working i guess... gonna figure out a work around but till then, yea this kinda works without the smoothness.

Its the starts of a camera Boone system...

for the time being i have http://www.babylonjs-playground.com/#AGOCE#5
which works but I want to get it all onto one line instead of 3 for the lerp.

I worked out most of this, and made a demo thread.

Link to comment
Share on other sites

8 hours ago, RaananW said:

Just thinking aloud - why won't you use the animation system?  http://doc.babylonjs.com/tutorials/Animations

Hmm, interesting raan.  I kinda skipped over that idea, and went right to how I would do it in unity.  I think maybe I'll take a look at doing the same thing but with animations and see how tha performs.  Do a bench test of my lerp loop vs animations, and I'm gonna go from there.

 

jerome I think the 3D path may be my ticket, I was just looking over it but it seems it automatically can construct distances between points which would be way easier to find points by percentage then.

so perhaps a combination of 3D path and animations instead of a custom lerp?

Link to comment
Share on other sites

Just looked at your roller coaster example, and learned freezeWorldMatrix, coolness.  Also I like how you did the car and handled it's rotation to the track very intuitive. 

Yea I just mocked this up really fast because I needed a way to more effectively animate my camera on set rails.  With the info you guys gave me and the prototype I'll be able to create what I need thank you!

I can't wait to see what you guys think of my surface2air middle tutorial I'm sure y'all will spawn tons of ideas.  I want to get it done though so I can move on the deploying a custom physics system for a dual blade helicopter.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...