Jump to content

logunov

Members
  • Content Count

    23
  • Joined

  • Last visited

About logunov

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you for the tip, I will try to figure out what's happening during linear transformations with camera. About mesh rotation, the snake on the sphere surface is not a mesh but dynamically changing object, because of some game triggers, so there is no possibility to follow it with camera (in my view, maybe it is possible). If I am trying to use pseudo-mesh, wich moves from points to points, that target camera or follow camera do not move around sphere surface, but in angle to it. ArcRotateCamera and ArcFollowCamera both dying in certain positions, maybe I did something wrong with it, I w
  2. @Deltakosh maybe video will explain better, than words After movement, starting on 0:20 to 0:23 camera changes angle of view, and there is much of this points on the sphere. I can't find a reason, why it happens. And I have no idea how to prevent this rotation.
  3. Thank you, @Deltakosh, for the advice and answer. There is isolated code, and there is no custom math: good result: https://www.babylonjs-playground.com/#AI1MQC#7 bad result: https://www.babylonjs-playground.com/#AI1MQC#6 One method, but different arguments. I added some comments and removed unnecessary code. 1) Setting pivot 2) Setting camera parent to pivot 3) Pivot looks at startPoint on sphere surface 4) Cloning pivot, making clone lookAt end point 5) Passing pivot.RotationQuaternion and cloned pivot.RotatingQuaternion (after lookAt method) to animator 6) Gettin
  4. https://www.babylonjs-playground.com/#X66D1S#2 here is additional demonstration, why I can not use ArcRotateСamera or Euler angles. In this example I changed method to use rotation instead of rotationQuaternion and when animation finishing camera immediately dying (I don't know how to call this phenomenon, gimbal lock probably ========== Upd: https://www.babylonjs-playground.com/#X66D1S#6 I though problem was in pivot method, but when I changed method to position from quaternions (not effective, but better, than nothing), it's still flip in certain points. I have no idea why
  5. Good day, Sir. First, I want to say Thanks to everyone, who spent time to read this, I will be glad and happy to hear any advices or notes about this issue. Here is a PG: https://www.babylonjs-playground.com/#AI1MQC#2 Please, hide the SetEnviroment(), getPointsArray() and cameraMoveAnimation() functions bodies to make code more readable, I specially out them from main code. As you can see, there is 2 important lines: 82 and 83. Each points from "points" array is a real data from real project, that is not random numbers. So, the camera should move from: point1 to point2, then p
  6. Thanks for the reply, but No, that's not what I need. I want to parametrically move in a circle (2D) in 3D space. And I cannot understand why, if I give 2 points as parameters of the lookAt rotary method, it leaves a circle. I say a circle, because I use quaternion mathematics, so 2 points must define an arc on the surface of a sphere, and if there are 3 points in the same plane of 3D space, they must define half of the circle.
  7. https://www.babylonjs-playground.com/#PP962K#13 I tried to make rotation from point1 to point2 to point3 in Oxy plane as you can see by coordinates, but after point2 the camera starts to choose a strange path out of Oxy. Why it happens?
  8. Well, normally I adding rigidbody component to the hairs, that makes them ragdollable. After that, each hat have a collider component, so, when they contact, collider of a hat pushing the ragdoll of hairs some in, and physic engine holds them under hat. But, the problem is I do not know, can babylon do this or not, and how ragdolls and rigidbody works here. The big minus of this approach is performance, but you can make pseudo ragdolling or something like that, if babylon provide this. =============== Well, the second solution, you can create mask layer over hat, which will over-rid
  9. Good day everyone, I have a simple question: where I am using transformNode.lookAt method, wich is parent of all lookAt methods, how can I understand where is the face? For example, I put the cube on the scene, and used lookAt of cube at some point, which side of cube will face this point? (which side of cube will look at this point) ?
  10. Thank you, @entropy, I finally made a solution, take a look: https://www.babylonjs-playground.com/#PP962K#8 And the real camera example: https://www.babylonjs-playground.com/#PP962K#9 Answers on my questions in order: 1) To provide quaternion rotation you need use transformNode as pivot, putted in the center of the rotation. In the problem of mine it will be origin between point1, point2 and normal (green, red and blue lines) 2) Babylon animation component slerping quaternions on it's own, just need to put ANIMATIONTYPE_QUATERNION and "rotationQuaternion" parameters, as shown bel
  11. Well, I have some experience in development, so there is some choices: First: Visual Studio huge community huge possibilities much of addons multi-language support much of space to install much of good addons is paid much of requirement to performance workspace Second: Visual Studio code portable small performance requirements, good performance small community no addons This probably should support intellisense, but I don't tested it Third: WebStorm from jetBrains company This is my favorite, it is specially developed to code on java script extreme
  12. Yes, you understand correctly. Box emulates (simulates) the camera movement, I need to move camera around sphere surface, but any of the given BABYLON camera going in gimble lock in pi/2 so I can not use default babylon camera, so I choosed 2 points on sphere, and want to rotate camera with quaternion to prevent gimble lock, but the problem camera rotates around itself or do not rotating. This two points will be exactly on the same sphere. var point1 = new BABYLON.Vector3.One() var point2 = new BABYLON.Vector3(3/2,0.5,0.70710678118654752440084436210485); More cl
  13. Thx a lot, @entropy, your reseach was extremly useful to understand BABYLON API better, but I found a two more problems, because of this understanding: 1) This should work only for meshes, because, as example, camera have no method to convert vertices, so, if I need to move camera by this idea, it is impossible, because it have no verices and method (it is just note, your method is good) 2) This do not work, if I choose arbitrary axis. Here is playground, demonstrating #2 on your code: https://www.babylonjs-playground.com/#H22U9B#2 Look at lines #32, and #49 and #59 - I change axis
  14. Thank you for notes, @entropy, it very useful and interesting. I want to formalize my question a bit deeper. so the question is: " Is babylon animation doing slerp with quaternions on their own, and which property I should pas to babylon animation to make movements with quaternions. or this stuff is not supported and I should code method, which will produce array of points, and pass this though keys to babylon animation with "position" property". This question is a little bit confusing me, because I don't find any clear explanation in API how to do something like that. Edit
×
×
  • Create New...