PolGuixe / meteor-datgui

0 stars 1 forks source link

Any help as in how to use dat.GUI without the package with meteor. #1

Open chauhanshubham-dev opened 9 years ago

chauhanshubham-dev commented 9 years ago

So I have added dat.gui.min.js in clients/compatibility and am trying to use it the general way. In the init function I have this, with other code consisting of rendering object (nothing out of the box).

 container = document.getElementById('model-container');
 var guiControls = new function() {
     this.rotationX = 0.0;
     this.rotationY = 0.0;
     this.rotationZ = 0.0;
 }
var datGUI = new dat.GUI({autoPlace:false});
datGUI.add(guiControls, 'rotationX', 0, 1);
datGUI.add(guiControls, 'rotationY', 0, 1);
datGUI.add(guiControls, 'rotationZ', 0, 1);
container.appendChild(datGUI.domElement);
container.appendChild(renderer.domElement);

In the render function I have

 function render() {
    group.rotation.x += guiControls.rotationX;
    group.rotation.y += guiControls.rotationY;
    group.rotation.z += guiControls.rotationZ;
    renderer.render(scene, camera);
}
function animate() 
{
    requestAnimationFrame(animate);
    render();
}

The page shows just the model, without gui of the controller

PolGuixe commented 9 years ago

Are you using the package?

Any errors in the console.log?

chauhanshubham-dev commented 9 years ago

No I am not using this package. Things are have been sorted out. Thanks for the reply

On Wed, Jun 24, 2015 at 3:40 AM, PolGuixe notifications@github.com wrote:

Are you using the package?

Any errors in the console.log?

— Reply to this email directly or view it on GitHub.