Raghavender Mylagary Posted May 19, 2017 Share Posted May 19, 2017 Hi, Is there any way to read 3d coordinates (x,y,z) in a scene? I have tried using the following code: //When pointer down event is raised scene.onPointerDown = function (evt, pickResult) { // if the click hits the ground object, we change the impact position if (pickResult.hit) { x = pickResult.pickedPoint.x; y = pickResult.pickedPoint.y; z = pickResult.pickedPoint.z; } }; But I could not read the value of z. Quote Link to comment Share on other sites More sharing options...
hunts Posted May 19, 2017 Share Posted May 19, 2017 @Raghavender Mylagary hello there, try to use: console.log(pickResult.pickedPoint)//to read all values or alert(pickResult.pickedPoint); Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 19, 2017 Share Posted May 19, 2017 Hunts suggestion should have led you to the problem. To be helpful I suggest you always give a PG where possible and not a limited part of the code. It could be that somewhere else you swapped a z for a Z and so the error would lie elsewhere rather than in the section of code you include. hunts 1 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.