Files
horus-3d/get_angles2.js
T
Luke The Dev 4fa4f13558 First Release of Claw3D (#11)
Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
2026-03-19 23:14:04 -05:00

23 lines
681 B
JavaScript

async function main() {
const THREE = await import("three");
// Earth rotation order is default XYZ.
// The beacon's local position.
const beaconLocal = new THREE.Vector3(-0.42, 1.32, -1.47).normalize();
// The camera's position during dive.
const cameraPos = new THREE.Vector3(0, 0.5, 2.05).normalize();
// We want to rotate beaconLocal to cameraPos.
// The required quaternion.
const q = new THREE.Quaternion().setFromUnitVectors(beaconLocal, cameraPos);
// Convert to Euler so we can damp x and y.
const e = new THREE.Euler().setFromQuaternion(q, "XYZ");
console.log("Target Euler:");
console.log("x:", e.x, "y:", e.y, "z:", e.z);
}
void main();