Forum Replies Created
-
AuthorPosts
-
picpic2006Participant
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 !
picpic2006ParticipantHi
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 room2021-03-26 at 2:07 pm in reply to: I found this cool .js camera navigation, can you help me add it to my scene #39793picpic2006ParticipantHi, 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 ?
picpic2006Participantthanks 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 ?
-
AuthorPosts