nodejs Posted November 14, 2017 Share Posted November 14, 2017 Hello, i am again... i have a realy noob question but cant find an answer. Since i playing with this Playground i try to figure out how i can get the position of the car (mesh = carBody ?) Im not successful. Line 42 - 44 scene.registerBeforeRender(function(){ console.log("Poisition", carBody.position); }); The only thing that changes is when i turning the steering wheel. Nothing about the position on the ground... I tought the carBody "merge" all meshes into one and move them around with them. So that the positions property on child meshes a relative to the parent mesh. I dont get it... Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted November 14, 2017 Share Posted November 14, 2017 Hi @nodejs That is because the carBody is parented to the "pivot" mesh See line 101 http://www.babylonjs-playground.com/#102TBD#57 nodejs 1 Quote Link to comment Share on other sites More sharing options...
nodejs Posted November 14, 2017 Author Share Posted November 14, 2017 Youre right buddy, but i tryed this befor and nothing has changed. Only when i turn the steering wheel. This is the axis of rotation if i undertsand it correct. There only move when my stering is 0, but i need the position of the centre from the car. at any time Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 14, 2017 Share Posted November 14, 2017 hello you can call mesh.getAbsolutePosition() to get what you need 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.