I wanna make for my game a Gui and i dont know how to Make this.
Can you pls Help me with this?
Cheers
Martin
I wanna make for my game a Gui and i dont know how to Make this.
Can you pls Help me with this?
Cheers
Martin
尝试使用如下代码定义 raft 相机:
var aspectRatio = window.innerWidth / window.innerHeight;
var camera = new THREE.PerspectiveCamera(75, aspectRatio, 0.1, 100);
camera.position.set(-8, 8, 8);
scene.add(camera);
var abovecam = camera;
var qCam = new THREE.PerspectiveCamera(75, aspectRatio, 1, 10000);
qCam.position.set(0, 0, 500);
qCam.position.z = 1;
qCam.rotation.z = Math.PI/2;
qCam.rotation.y = Math.PI/2
将此相机添加到筏子:
function addRaft() {
var shape = new THREE.TorusGeometry(0.1, 0.05, 8, 20);
var _cover = new THREE.MeshPhongMaterial({visible: false});
var cover = new Physijs.createMaterial(_cover, cover, 0.25);
var mesh = new Physijs.ConvexMesh(shape, cover, 0.25);
mesh.rotation.x = -Math.PI/2;
var furFace = rColor();
cover = new THREE.MeshPhongMaterial({color: furFace});
var tube = new THREE.Mesh(shape, cover);
tube.position.z = -0.08;
tube.castShadow = true;
mesh.add(tube);
mesh.tube = tube;
mesh.add(qCam);
shape = new THREE.SphereGeometry(0.02);
cover = new THREE.MeshBasicMaterial({color: 'white'});
var rudder = new THREE.Mesh(shape, cover);
rudder.position.set(0.15, 0, 0);
tube.add(rudder);
scene.add(mesh);
mesh.setAngularFactor(new THREE.Vector3(0, 0, 0));
return mesh;
}