JohnK

Members
  • Content count

    589
  • Joined

  • Last visited

  • Days Won

    10

JohnK last won the day on February 19

JohnK had the most liked content!

1 Follower

About JohnK

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://babylonjsguide.github.io/

Profile Information

  • Gender
    Male
  • Location
    England, Buckinghamshire

Recent Profile Visitors

1,987 profile views
  1. Here is your first post In this post you gave the PG https://www.babylonjs-playground.com/#VGUTRM This seems to stay in xy plane. Look at difference between the 2 PGs and camera creation. Also in the above PG VGUTRM you can delete lines 1 to 7 they are not needed in a PG as the playground system deals with initialising the scene from the engine. On mobile so cannot edit PG myself.
  2. Would using a parent and child help as in http://www.babylonjs-playground.com/#12WBC#87
  3. Just a suggestion but IMHO you are better off asking a new question rather than adding one to the end of an old topic. How about var offset = new BABYLON.Vector3(0, 2, 0); //or whatever numbers you need var targetPosition = cameraTarget.getAbsolutePosition().add(offset);
  4. Have you considered using scene.registerAfterRender (or scene.registerBeforeRender) to do the animation. This PG shows a very simple use http://www.babylonjs-playground.com/#92EYG#10 IMHO to do this you would need, in the registerAfterRender function call, to get the vertex data from the existing mesh, dispose the existing mesh and form new vertexdata by adjusting existing vertex data adding/subtracting new vertices and then create a new mesh with the new data. Everything I know currently about vertexdata for an existing mesh restricts you to updates only on the existing vertices. You probably know this already but just in case here is a tutorial about creating a custom mesh Good luck EDIT as an alternative use a sequence of animations on your 3 meshes http://babylonjsguide.github.io/basics/Starter http://babylonjsguide.github.io/basics/Combine.html http://babylonjsguide.github.io/gamelets/Sequence
  5. In Firefox 52.0.2 (64-bit) I am not getting the OK button with the Metadata dialogue box, OK with Chrome.
  6. Sorry it is taken so long to get a reply. Hopefully, if I have understood what setFromUnitVectors does, the following does the equivalent where v1 and v2 are unit vectors var angle = Math.acos(BABYLON.Vector3.Dot(v1, v2)); var axis = BABYLON.Vector3.Cross(v1,v2); var quaternion = BABYLON.Quaternion.RotationAxis(axis, angle); var matrix = BABYLON.Matrix.Identity(); BABYLON.Matrix.FromQuaternionToRef(quaternion, matrix); As you have not given the context for use I have not tested the above.
  7. More reading about normals http://babylonjsguide.github.io/advanced/Normals Mesh.CreateBox creates a flat shaded mesh Mesh.CreateSphere and others do not
  8. Nor should you. When I was teaching I would have said "A deliberate error to check you are listening" but now I have no excuses other than senility Document corrected thank for the heads up @Wingnut
  9. || means or if (evt.keyCode==68 || evt.keyCode == 100){ //D or d
  10. Only way I know is with the ifs if(map["W"] || map["w"]) { character.position.y +=5; } Have a go at a simple playground and ask again if necessary. You can find a more on using actions and using keys as triggers at http://doc.babylonjs.com/tutorials/how_to_use_actions#triggers (again more ifs - they really are needed) Basic character control using keys with javascript at http://www.gaminglogy.com/tutorial/controls-keyboard/
  11. Is this of help? http://www.babylonjs-playground.com/#102TBD#33 This method allows for two keys pressed at once but one at a time is ok. Lines 139 to 149 check for keys down or up, action for keys in registerAfterRender loop.
  12. Is this something close to what you want? http://www.babylonjs-playground.com/#U64HVU#3
  13. Have now gone back to the drawing board and did some more exploring about when and when not meshes collide. If meshes are moving 'too fast' then they can never intersect during a frame. Even if a number of particles start out slowly it is possible that collisions between them can increase the speed of some particles while slowing others. This PG shows one particle moving at 8 times its original speed after colliding with others http://www.babylonjs-playground.com/#1DJ7RH#3 My musings on this can be found at http://babylonjsguide.github.io/gamelets.html under the collisions section. This is still under development and slowly I will get back to complex shapes only this time with more consideration.
  14. Welcome to the forum. Imho you are not getting answers because people do not understand what you want. Can you draw or supply a picture of what you want?