Raitch Posted January 30, 2017 Author Share Posted January 30, 2017 If the arrow was pointing "downwards" all the time, using wAng would be a piece of cake, but it seems to be in different angles depending on where on the sphere you hover. I don't really get this part of the code, so am not sure if it's easy to fix BABYLON.Vector3.CrossToRef(start, axis1, axis2); BABYLON.Vector3.CrossToRef(axis2, axis1, axis3); var tmpVec = BABYLON.Vector3.RotationFromAxis(axis3.negate(), axis1, axis2); var quat = BABYLON.Quaternion.RotationYawPitchRoll(tmpVec.y, tmpVec.x, tmpVec.z); if (pickInfo.pickedMesh.rotationQuaternion) box.rotationQuaternion = pickInfo.pickedMesh.rotationQuaternion.multiply(quat); else box.rotationQuaternion = quat; Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 30, 2017 Share Posted January 30, 2017 Ahh, yes, this is derived from "surface-following Susanne" (#8 in the series). Sorry about that. I gave you a bad answer. Texture wAng is not controllable or predictable... when the mesh itself is Z-rotating. *nod* We might need to say goodbye to quaternions, and try something like billboard mode (pretend camera inside sphere). Unfortunately, billboard suffers z-spin near the poles... and that will kill THAT idea, too. Interesting challenge. Have you tried standard plane... with setPivotMatrix at sphere center? I suppose that method has problems if/when the sphere has some mountains and valleys on it. 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.