question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

attaching a Flycam to an object

See original GitHub issue

ok so i want to attach a flycam behind my spacecraft. I have loaded the geometry into the scene previously:

starship = THREE.SceneUtils.addMesh( scene, geometry, 1, 0, 0, 0, 0, 1.0, 0.0, m );

but i think starship is just a copy of mesh i loaded, and i need a pointer to the object in the scene stack. In order to set its new position matrix.

                           //get the position of the fly camera
            var  position = new THREE.Matrix4;
            position = camera.matrix;   
            //set a translation to move the point infront of the camera
            translation = new THREE.Matrix4;
            translation.setTranslation(0,100,1000);
            //multiply the two matrices together
            result = new THREE.Matrix4;
            result.multiply(position,translation); 

I am guessing this wont work: starship.matrix.copy(result); starship.updateMatrix();

Should i approach it through the scene objects like this? i seem to get an error…

            scene.objects[0].matrix.copy(result);
            scene.objects[0].updateMatrix();

Thanx again.

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
WestLangleycommented, Oct 17, 2012

addChild() is now simply add().

0reactions
mrdoobcommented, Oct 17, 2012

I wish closed issues didn’t allow more comments… Specially 1 year old ones…

Read more comments on GitHub >

github_iconTop Results From Across the Web

FlyCamera - Babylon.js Documentation
This is a flying camera, designed for 3D movement and rotation in all directions,such as in a 3D Space Shooter or a Flight...
Read more >
Flycam - Second Life Wiki
It's also possible to use the FlyCam mode with the very popular Xbox 360 controller, provided you have one you can connect to...
Read more >
How would I mount a v-mount battery to a flycam red king ...
I am planning on adding a v-mount battery plate to my flycam red ... r/cinematography - How do you get metal objects to...
Read more >
Fly Cam (simple cam script) - Unity Forum
* 1) adding an isColliding bool to allow camera to collide with world objects, terrain etc. */. public float mainSpeed = 100.0f ...
Read more >
FLYCAM Vista-II Stabilizing Arm & Vest for Handheld Camera ...
The spring arm and vest connect, assisting the stabilizer and significantly improving the overall functionality and reducing operator fatigue. It lets you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found