嘿,我在使用THREE.Vector3中的lagre值时遇到问题并拿到相机 同时纠正。我试图将钻井路径画成一条线。
Y值可以是6000000,X可以是500000米,这些值是 钻井。
下面的代码将显示一个小行,但如果我增加示例中的值 什么都没有显示出来。
那么如何处理像这样的大值。我会读那些 数据库
var camera, scene, renderer, geometry, material;
init();
animate();
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 2000000);
camera.position.z = 1200000
var material = new THREE.LineBasicMaterial({
color: 0x0000ff,
});
var geometry = new THREE.Geometry();
geometry.vertices.push(new THREE.Vector3(500000, 400000, 0));
geometry.vertices.push(new THREE.Vector3(500000, 400000, 10000));
geometry.vertices.push(new THREE.Vector3(500000, 400000, 25000));
var line = new THREE.Line(geometry, material);
scene.add(line);
renderer = new THREE.CanvasRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
}
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
renderer.render(scene, camera);
}