是否可以在three.js 中从maya 加载inka3d 导出的项目?我尝试从three.js 导出maya,但没有奏效。当我使用 Inka3d 导出并打开创建的 html 文件时,Maya 动画运行完美。
我在maya中制作的动画有问题吗?它是一张纸卡,用四个关节进行简单的折叠。用three.js打开和加载它的最佳方法是什么?我想在其余的编码中使用 three.js。
谢谢
这是我尝试使用 three.js maya 插件导出文件打开的代码
<html>
<head>
<title>My first Three.js app</title>
<style>canvas { width: 100%; height: 100% }</style>
</head>
<body onload="webGLStart();">
<script type="text/javascript" src="js/Karte2.js"></script>
<script type="text/javascript" src="js/three.js"></script>
<script type="text/javascript" src="js/src/loaders/JSONLoader.js"></script>
<script type="text/javascript">
var camera, scene, renderer, mesh, loader;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = 1000;
scene = new THREE.Scene();
loader = new THREE.JSONLoader();
loader.load( "js/Karte2.js", function( geometry ) {
mesh = new THREE.Mesh( geometry, new THREE.MeshNormalMaterial() );
mesh.scale.set( 10, 10, 10 );
mesh.position.y = 150;
mesh.position.x = 0;
scene.add( mesh );
} );
var ambientLight = new THREE.AmbientLight(0x555555);
scene.add(ambientLight);
var directionalLight = new THREE.DirectionalLight(0xffffff);
directionalLight.position.set(1, 1, 1).normalize();
scene.add(directionalLight);
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
}
function animate() {
requestAnimationFrame( animate );
//mesh.rotation.x += 0.05;
renderer.render( scene, camera );
}
</script>
</body>
</html>