We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

picpic2006

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Ehanced camera controls how to… #39888
    picpic2006
    Participant

    hi, i finally manage to import and use orbitcontrol
    First i added in my .html
    type module to import in ncsExplorer the script

    <script type=”module” src=”NCSExplorer.js”></script>

    then in my javascript

    import { OrbitControls } from ‘./OrbitControls.js’;

    and finally

    function runCode(app) {

    var cam = app.scene.getObjectByName(‘MaCameraFixe’);
    var controls = new OrbitControls(cam,app.renderer.domElement);
    controls.enableDamping = true; // an animation loop is required when either damping or auto-rotation are enabled
    controls.dampingFactor = 0.05;
    controls.screenSpacePanning = false;
    controls.minDistance = 100;
    controls.maxDistance = 3000;
    controls.maxPolarAngle = Math.PI / 2.5;

    }

    Do you think this is the way ?

    For me it work locally but i can’t upload to the serveur i couldn’t load my resource ! :wacko:

    in reply to: Ehanced camera controls how to… #39836
    picpic2006
    Participant

    Hi

    I tried several things but nothing work for me at the moment.
    I read the documentation, i found that i can pass code in runcode function.

    https://cdn.soft8soft.com/demo/examples/index.html?q=misc#misc_controls_orbit

    In this exemple all the scene is created by code that is less difficult to understand to me but my test is made with the default template so my camera is all ready done in blender. I made it with no controls but now i have to point to it and pass to orbitcontrols and do see where to do that. I try to my project.html, but didn’t work to.
    Can you give me a way to go for the moment i’m in a dark room :wacko:

    picpic2006
    Participant

    Hi, we have the same question !
    i tried to link it via puzzles with no success, and i can’t see were i can link and manupulate my camera by code.

    have you succeed ?

    in reply to: Ehanced camera controls how to… #39792
    picpic2006
    Participant

    thanks for the reply, i understand that i have to do this by code, the probleme is how to import orbitcontrol.js from this exemple and use it for the camera can we do that with puzzle or should i import it in a given script and pass the camera to it ?

    https://threejs.org/examples/#misc_controls_map

Viewing 4 posts - 1 through 4 (of 4 total)