Andrey Zimin Posted February 24, 2018 Share Posted February 24, 2018 Hi friends! There are two objects A and B. How can I move the object A using the coordinate system of object B? Object B - not the world's axis! Quote Link to comment Share on other sites More sharing options...
JohnK Posted February 24, 2018 Share Posted February 24, 2018 Have you checked this out http://doc.babylonjs.com/how_to/transformnode Andrey Zimin 1 Quote Link to comment Share on other sites More sharing options...
Andrey Zimin Posted February 24, 2018 Author Share Posted February 24, 2018 20 minutes ago, JohnK said: Have you checked this out http://doc.babylonjs.com/how_to/transformnode This involves add parent on mesh! Not parent! Quote Link to comment Share on other sites More sharing options...
adam Posted February 24, 2018 Share Posted February 24, 2018 Use Vector3.TransformCoordinateToRef: http://playground.babylonjs.com/#UKH76V Andrey Zimin 1 Quote Link to comment Share on other sites More sharing options...
Andrey Zimin Posted February 25, 2018 Author Share Posted February 25, 2018 17 hours ago, adam said: Use Vector3.TransformCoordinateToRef: http://playground.babylonjs.com/#UKH76V Yeah. but if I at the moment of moving the body A begin to move the body B, then all the work is useless. Thus the need to use the method suggested above! I.e. create a temporary parent and from him to count! var CoT = new BABYLON.TransformNode("root") adam 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted February 25, 2018 Share Posted February 25, 2018 If you have a found a method that works for you that's good and I would stick to it. However like @adam I cannot yet see the problem you might have with his method. In his example B is the ground and A the sphere. You can move A and B and still have A moving relative to B http://playground.babylonjs.com/#UKH76V#1 Should you want to explain further the issue 5 hours ago, Andrey Zimin said: if I at the moment of moving the body A begin to move the body B, then all the work is useless. Thus the need to use the method suggested above! I.e. create a temporary parent and from him to count! the please add a playground. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.