Comments (6)
That's great you find a fix. Hard to tell if it's a good one or not without a full example of what you're doing and how you switch between the two controls. You can close the issue if this change looks good to you.
from superframe.
okay I got it.. i just added an event listener
let transform_controls = new TransformControls(camera, scene.sceneEl.renderer.domElement)
transform_controls.attach(elem)
transform_controls.addEventListener( 'dragging-changed', function ( event ) {
current_camera = document.getElementById('camera')
if (event.value) {
current_camera.pause()
return
}
current_camera.play()
} )
from superframe.
another problem is that after I move the entity, the camera returns to its target coordinate.. it doesn't stay in the previous position
from superframe.
This seems to be a problem specific to your project code. You'll probably have a better chance of finding a solution to your issue on WebXR Discord aframe channel if you provide a glitch example of the issue.
from superframe.
I fixed the problem by removing controls.target = this.target.copy(data.target);
in the update function of orbit-control
from superframe.
For documentation purposes here is my code:
const elem = document.getElementById(primitive.id).getObject3D('mesh')
const camera = document.getElementById('camera').getObject3D('camera')
let transform_controls = new TransformControls(camera, scene.sceneEl.renderer.domElement)
transform_controls.attach(elem)
transform_controls.addEventListener('dragging-changed', function (event) {
// disable orbit control when doing transform(translate, rotate and scale)
orbit_control.enabled = !event.value
})
transform_controls.addEventListener('objectChange', (e) => {
// update selected model
updateControlModel(e.target.object)
})
scene.object3D.add(transform_controls)
in my orbit-control.js
// controls.target = this.target.copy(data.target);
controls.cursor = this.cursor.copy(data.cursor);
controls.autoRotate = data.autoRotate;
controls.autoRotateSpeed = data.autoRotateSpeed;
controls.dampingFactor = data.dampingFactor;
controls.enabled = data.enabled;
controls.enableDamping = data.enableDamping;
controls.enablePan = data.enablePan;
controls.enableRotate = data.enableRotate;
controls.enableZoom = data.enableZoom;
controls.keyPanSpeed = data.keyPanSpeed;
controls.maxPolarAngle = THREE.MathUtils.degToRad(data.maxPolarAngle);
controls.maxAzimuthAngle = THREE.MathUtils.degToRad(data.maxAzimuthAngle);
controls.maxDistance = data.maxDistance;
controls.minDistance = data.minDistance;
controls.minPolarAngle = THREE.MathUtils.degToRad(data.minPolarAngle);
controls.minTargetRadius = data.minTargetRadius;
controls.maxTargetRadius = data.maxTargetRadius;
controls.minAzimuthAngle = THREE.MathUtils.degToRad(data.minAzimuthAngle);
controls.minZoom = data.minZoom;
controls.maxZoom = data.maxZoom;
controls.panSpeed = data.panSpeed;
controls.rotateSpeed = data.rotateSpeed;
controls.screenSpacePanning = data.screenSpacePanning;
controls.zoomSpeed = data.zoomSpeed;
controls.zoomToCursor = data.zoomToCursor;
from superframe.
Related Issues (20)
- log component is pretty broken in a few ways
- [atlas-uvs] broken in A-Frame 1.2+ due to three.js switch to buffer geometries HOT 4
- look-at component does not accept vector after a selector has been used
- [orbit-controls] doesn't update camera children
- event-set cannot set attributes on components with a dash in their name. HOT 6
- geometry-merger, no working demo, example code doesn't work HOT 2
- Orbit-Controls: Rotating seems to reset the dolly maxDistance to 180 HOT 1
- [audio-analyser] mobile not supported
- geometry-merger not working HOT 3
- layout type line align center not working as expected
- Add support to "magicWindowTrackingEnabled: false" to "orbit-conrols" HOT 1
- Orbit camera and WASD is broken from 0.9.2, orbit camera broken from 1.4.0 HOT 1
- `getOrCreateObject3D` has been deprecated. Use `setObject3D()` and `object3dset` event instead.
- Haptics example not working HOT 2
- Needs update for aframe v1.4.0 HOT 2
- atlas-uvs component: loss of UVs coordinates when changing geometry
- [template] case mustache return handlebars compiler HOT 1
- orbit-controls doesnt work correctly with a-camera primitive HOT 8
- orbit-controls initialization position is inaccurate HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superframe.