JSFiddle - React, Tailwind, and code Playground
by Bretto
HTML
<script src="https://threejs.org/build/three.js"></script>
CSS
body {
margin: 0;
}
JavaScript
var a = new THREE.Object3D();
const dotGeometry = new THREE.BufferGeometry();
dotGeometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([0, 0, 0]), 3));
const dotMaterial = new THREE.PointsMaterial({
size: 0.01,
color: '0xff0000'
});
const p = new THREE.Points(dotGeometry, dotMaterial);
a.add(p);
a.translateX(10)
a.rotateY(THREE.MathUtils.degToRad(90))
a.updateMatrixWorld();
const t = new THREE.Vector3(0, 0, 0);
console.log(a.localToWorld(t));
console.log(a.getWorldPosition(t));