我尝试使用三个 js 版本的 r55 显示精灵,但屏幕上没有任何内容。有人可以帮我找出错误吗?我没有在本地加载东西以防止出现一些错误。我不明白为什么所有 3d 对象都可以正常工作,而不是纹理或精灵。谢谢大家
var startTime = Date.now();
var container = document.getElementById('container');
var camera, scene, renderer;
var ambientlight,directionallight;
var texturenuage, obj1;
init();
animate();
function init() {
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 30, 901 / 727, 1, 1000 );
camera.position.x = 0;
camera.position.y = 0;
camera.position.z = 1000;
ambientlight = new THREE.AmbientLight(0x220066);
scene.add( ambientlight );
directionallight = new THREE.DirectionalLight( 0xff88aa );
directionallight.position.set( 40, 50, 100 ).normalize();
scene.add( directionallight );
texturenuage = new THREE.ImageUtils.loadTexture('nuage1.png');
obj1 = new THREE.Sprite( new THREE.SpriteMaterial( { color: 0xff0000, map: texturenuage, alphaTest: 0.5 } ) )
sprite.scale.set( 381, 84, 1.0 )
sprite.position.set( 100, 100, 0 );
sprite.position.normalize();
scene.add( obj1 );
renderer = new THREE.WebGLRenderer();
renderer.sortObjects = false;
renderer.setSize( 901, 727 );
container.appendChild( renderer.domElement );
}
function animate() {
render();
requestAnimationFrame( animate );
}
function render() {
renderer.render(scene, camera);
}