2021年4月11日星期日

"object3d.quaternion.set(q)" doesn't work?

I have a quaternion that I want to ".set", not ".apply". I could get the world quaternion and calculate what I need to ".apply" to get what I want, but isn't it reasonable that ".set" should work?

In this code, trying the "scene.quaternion.set()" causes the scene to vanish.

  "use strict";      let scene, camera, renderer, geometry, material, mesh, quaternion;    scene = new THREE.Scene();    camera = new THREE.PerspectiveCamera( 40, 800/600, 0.1, 10 );    camera.position.z = 5;    renderer = new THREE.WebGLRenderer();    renderer.setSize( 800, 600 );    document.body.appendChild( renderer.domElement );      geometry = new THREE.SphereGeometry(1);    material = new THREE.MeshNormalMaterial( { wireframe:true } );    mesh = new THREE.Mesh( geometry, material );    scene.add( mesh );    quaternion = new THREE.Quaternion(0, .6, 0, .8);  // the following statement causes the scene to vanish:  //  scene.quaternion.set(quaternion);    renderer.render( scene, camera );  
https://stackoverflow.com/questions/67051837/object3d-quaternion-setq-doesnt-work April 12, 2021 at 10:07AM

没有评论:

发表评论