Papervision3D坐标转换

3D转2D
do3d.calculateScreenCoords(camera3D);
var real2DX:Number = do3d.screen.x + viewport3D.width/2;
var real2DY:Number = do3d.screen.y + viewport3D.height/2;

2D转3D
var ray:Number3D = camera.unproject(viewport.containerSprite.mouseX, viewport.containerSprite.mouseY);
ray = Number3D.add(ray, camera.position);

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注