小编Pat*_*ryk的帖子

如何计算两架飞机之间的角度?

我有两架飞机,我怎么能计算它们之间的角度?是否也可以像平面一样计算两个Object3D点之间的角度?

下面是一个例子:https://jsfiddle.net/rsu842v8/1/

  const scene = new THREE.Scene();
  const camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000);
  camera.position.set(25, 25, 12);

  var material = new THREE.MeshBasicMaterial({
    color: 0x00fff0,
    side: THREE.DoubleSide
  });
  window.plane1 = new THREE.Mesh(new THREE.PlaneGeometry(10, 10), material);
  scene.add(plane1);

  plane1.position.set(0.3, 1, -2);
  plane1.rotation.set(Math.PI / 3, Math.PI / 2, 1);

  window.plane2 = new THREE.Mesh(new THREE.PlaneGeometry(10, 10), new THREE.MeshBasicMaterial({
    color: 0x0fff00,
    side: THREE.DoubleSide
  }));
  scene.add(plane2);


  // setup rest
  var pointLight = new THREE.PointLight(0xFFFFFF);
  pointLight.position.x = 10;
  pointLight.position.y = 50;
  pointLight.position.z …
Run Code Online (Sandbox Code Playgroud)

javascript math 3d rotation three.js

1
推荐指数
1
解决办法
597
查看次数

标签 统计

3d ×1

javascript ×1

math ×1

rotation ×1

three.js ×1