Sorry.
So im making 3D world where you can move inside.
I have coded the controls based on PointerLockControls
Its a very big proyect, but this are the relevant parts of the CSS3RENDERER and webGLRenderer.
I have configure my render :
renderer = new THREE.WebGLRenderer({ antialias: true ,alpha:true});
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( Ancho,Alto );
renderer.shadowMap.enabled = true;
renderer.setClearColor( 0x000000 ,0.0);
document.getElementById('renderWEBGL').appendChild(renderer.domElement);
scene = new THREE.Scene();
My camera :
camera = new THREE.PerspectiveCamera( 80,
window.innerWidth / window.innerHeight,
1,
2000 );
This is the configuration of my CSS3DRENDERER :
var container = document.getElementById( 'renderCSS3D' );
//camera2 = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 5000 );
//camera2.position.set( 500, 350, 750 );
var SCENE_SCALE =0.1;
scene2 = new THREE.Scene();
scene2.scale.set(SCENE_SCALE,SCENE_SCALE,SCENE_SCALE);
renderer2 = new THREE.CSS3DRenderer({ antialias: true ,alpha:true});
renderer2.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer2.domElement );
var offsetX = window.innerWidth/2;
var offsetY = window.innerHeight/3;
offsetY =0;
offsetX = 500;
var sep = 50;
var offsetZ = -100;
//offsetX = 0;
//offsety = 0;
cssGroup = new THREE.Group();
cssGroup.add( new Element( 'SJOz3qjfQXU', 0+offsetX, 0+offsetY, sep+offsetZ, 0 ) );
cssGroup.add( new Element( 'Y2-xZ-1HE-Q', sep+offsetX, 0+offsetY, 0+offsetZ, Math.PI / 2 ) );
cssGroup.add( new Element( 'IrydklNpcFI', 0+offsetX, 0+offsetY, - sep+offsetZ, Math.PI ) );
cssGroup.add( new Element( '9ubytEsCaS0', - sep+offsetX, 0+offsetY, 0+offsetZ, - Math.PI / 2 ) );
scene2.add( cssGroup );
this is a function that calculates the translation of the previus position to next position each time you pressed the mouse :
function animarmovimiento(){
//ANIMACION :
if(ismoving){
helperG.visible = false;
//helper.visible = false;
lerpway+=0.01;
var aux = new THREE.Vector3();
aux.lerpVectors(startvec,endvec,lerpway*0.1);
controls.getObject().position.copy(aux);
if(lerpway>0.8){
lerpway = 0;
ismoving = false;
}
} else{
helperG.visible = true;
//helper.visible = true;
}
}
This is the animate function :
if(showfps){stats.begin();}
animarmovimiento(); //Animates de translation of the camara :
keyPressed(); //What happens when you press a key
requestAnimationFrame( animate );
//Composer en vez del renderer para hacer el outline
//I try multiply and divide camera without luck
//camera.position.multiplyScalar(10);
renderer2.render( scene2, camera );
//camera.position.divideScalar(10);
renderer.render( scene, camera );
controls.updateMove(); //Update the dragging of pointer Lock Camara
helper_update(); //This makes the thing in the mouse moves
if(showfps){stats.end();}
Here is the running example in my webPage : http://mmtt.com.ar/sgp_ultimate3_test/render.html
I´ve tryed :
-Multiply /divide scalar of camera (not working).
-Scaling the scene by : 0.01, 0.25, 0.1, and all sort of numbers. Somes seem to be more accurate, but no matter value I test i always get some displacement when i´ve translate.
-Tryed scaling each css3DObject.