是否有可能在three.js中加載一個來自maya的inka3d導出項目? 我試圖從three.js出口的瑪雅,但沒有奏效。當我用Inka3d導出並打開創建的HTML文件時,Maya動畫運行完美。inka3d導出加載在three.js
在瑪雅製作的動畫有問題嗎?這是一張用四個關節進行簡單摺疊的紙卡。 打開並加載three.js的最佳方法是什麼?我想使用three.js編碼的其餘部分。
感謝
這裏是我的代碼,我試圖與three.js所瑪雅插件導出的文件
<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>
你知道在某處是否有inka3d文件格式規範嗎? – mrdoob
沒有一個。但這裏是我的.js文件我想加載three.js [jsfiddle鏈接](http://jsfiddle.net/puhZF/) –