Hello,
I create a 3D logo with Strata Design 3D SE7. It’s possible to export file in several formats, especially in .DAE.
I used three.js and different sources on the web to build this code :
var renderer, scene, camera, mesh;
init();
animate();
function init(){
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.getElementById(‘logo’).appendChild(renderer.domElement);
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.set(0, 0, 1000);
scene.add(camera);
var colladaReady = function(collada) { dae = collada.scene; dae.scale.x = dae.scale.y = dae.scale.z = 0.002; dae.rotation.x = -Math.PI/2; dae.updateMatrix(); scene.add(collada, dae); }
var model_loader = new THREE.ColladaLoader();
model_loader.load(’…/js/test.dae’, colladaReady);
var lumiere = new THREE.DirectionalLight( 0xffffff, 1.0 );
lumiere.position.set( 0, 0, 400 );
scene.add( lumiere );
}
function animate(){
requestAnimationFrame(animate);
renderer.render(scene, camera);
}
And nothing is displayed. And no error on the console.
I tested with different files .dae (by creating with strata and dowload in web) but there is nothing that appears.
Hi!
Could you explain the logics of the order of the lines in this function?
There is no place in your code, where you call this function, except that you call it from itself, kind of recursively.
Have a look at the source code of the example with collada.
If I use your model in webgl_loader_collada, everything works fine. I’ve only changed the URL of the load() method and slightly adjusted the scale of the scene via collada.scene.scale.set( 0.01, 0.01, 0.01 ); in the callback function.
I think that I have a problem with position of files. When I do the same test of you, it’s ok but color is purple and not blue. And if I test the same file in other folder (with change url for three.js, ColladaLoder.js, …), I have the same error. I think there is an url who is affect with the variable object. And if the file .dae is not in a same folder so three.js don’t find model and stop.
Do you know if it’s possible to have a formation to use this program in France ?
For the moment, I tested only with the letter E. Do you know why in three.js there is a veil on the letter, as if my .dae file was a partially transparent cube ?
I find the problem : it’s the soft Strata what makes a bad export in .dae because it works with SketchUp.
Now, I research to make the logo of laboratory to put it in my HTML page. It’s a normal page with informations and pictures.
I want to create a logo with several parts to create an animation internal to the logo. So I create several .dae files to be include in page with three.js
How to remove the small frame at the top left that displays counters and graphics (elf model) ?
And it is possible to change the background color of thee.js ? I wish it was transparent…