Jump to content

Can i get Mesh's all vectors position


BangTao
 Share

Recommended Posts

@JohnK @jerome thank you! and now ,i wanna create a custom mesh,and i'm trying to add animation to my custom mesh which is derived from 3DMax,every thing is fine until 

scene.beginAnimation(customMesh, 0, 97, false);

I don't know why is this ///

and if possible,how can i directly control this mesh's animation use method(↓)every per second?

// 3 parameters to create an event:
// - The frame at which the event will be triggered
// - The action to execute
// - A boolean if the event should execute only once (false by default)
var event1 = new BABYLON.AnimationEvent(50, function() { console.log("Yeah!"); }, true);
// Attach your event to your animation
animation.addEvent(event1);

 

Thx

D2K@~5OT_AAQ$@NB4]PFBRF.png

5Q8_O[BTUNMK]K3CITJ`DCL.png

QQ截图20170116195416.png

Link to comment
Share on other sites

Let's try to simplify your problem. This link http://babylonjsguide.github.io/basics/Starter will give you information on a very simple animation http://www.babylonjs-playground.com/#9WUJN#11

This we can then modify so that after 1 second and event is fired on frame 1 * frameRate as in this playground http://www.babylonjs-playground.com/#9WUJN#17

Your next step is in the playground to just change the animation into one you want step by step checking it works at each stage. This way by building on a simple animation we will be able to help with any errors that show up.

NOTE  a rotationQuaternion is NOT an array it is a BabylonJS Quaternion object so keys will be like

keys.push({
        frame: 0,
        value: new BABYLON.Quaternion.RotationAxis(-0.1098, -0.6771, 0.0.0096, -0.7276)
    });

It will be very much easier to help you step by step than with a large amount of code.

Link to comment
Share on other sites

20 hours ago, JohnK said:

Your next step is in the playground to just change the animation into one you want step by step checking it works at each stage. This way by building on a simple animation we will be able to help with any errors that show up.

Unless you build on the Playground I gave you above and reproduce the errors in the Playground I will no be able to help you further. Others might.

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...