提交 70785649 编写于 作者: M Mr.doob

Sprites example cameraOrtho frustum from 1 to 10 as per @WestLangley suggestion.

上级 9d5bbb71
......@@ -40,7 +40,7 @@
camera = new THREE.PerspectiveCamera( 60, width / height, 1, 2100 );
camera.position.z = 1500;
cameraOrtho = new THREE.OrthographicCamera( - width / 2, width / 2, height / 2, - height / 2, 0, 10 );
cameraOrtho = new THREE.OrthographicCamera( - width / 2, width / 2, height / 2, - height / 2, 1, 10 );
cameraOrtho.position.z = 10;
scene = new THREE.Scene();
......@@ -149,11 +149,11 @@
var imageWidth = material.map.image.width / 2;
var imageHeight = material.map.image.height / 2;
spriteTL.position.set( - width + imageWidth, height - imageHeight, 0 ); // top left
spriteTR.position.set( width - imageWidth, height - imageHeight, 0 ); // top right
spriteBL.position.set( - width + imageWidth, - height + imageHeight, 0 ); // bottom left
spriteBR.position.set( width - imageWidth, - height + imageHeight, 0 ); // bottom right
spriteC.position.set( 0, 0, 0 ); // center
spriteTL.position.set( - width + imageWidth, height - imageHeight, 1 ); // top left
spriteTR.position.set( width - imageWidth, height - imageHeight, 1 ); // top right
spriteBL.position.set( - width + imageWidth, - height + imageHeight, 1 ); // bottom left
spriteBR.position.set( width - imageWidth, - height + imageHeight, 1 ); // bottom right
spriteC.position.set( 0, 0, 1 ); // center
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册