Comments (6)
I have no issue with the default example and [email protected]
Calling document.querySelector('[orbit-controls]').components["orbit-controls"].controls.reset()
works correctly.
Your issue is probably in your project. Please provide a glitch if you want further help.
Be sure to use 1.3.2, previous versions didn't have this line:
from superframe.
I have no issue with the default example and [email protected] Calling
document.querySelector('[orbit-controls]').components["orbit-controls"].controls.reset()
works correctly. Your issue is probably in your project. Please provide a glitch if you want further help. Be sure to use 1.3.2, previous versions didn't have this line:
The three pictures above are:
- Start perspective
- Moved perspective
- Reset perspective
My code:
setInterval(() => {
document
.querySelector('[orbit-controls]')
.components['orbit-controls'].controls.reset();
}, 3000);
I tried writing a simple demo and had this problem.
<head>
<title>My A-Frame Scene</title>
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-orbit-controls.min.js"></script>
<script>
setInterval(() => {
document
.querySelector("[orbit-controls]")
.components["orbit-controls"].controls.reset();
}, 3000);
</script>
</head>
<body>
<a-scene
shadow="enabled: true;"
physics
cursor="rayOrigin: ''"
embedded="{needEmbedded}"
environment="preset: forest"
>
<a-box position="0 1 0" width="2" height="2" depth="2"></a-box>
<a-camera
id="camera"
orbit-controls="autoRotate: false; target: 0 0 0; initialPosition:0 1 5; minDistance:5; maxDistance: 180; rotateSpeed: 0.5"
/>
</a-scene>
</body>
from superframe.
You're the second person that use the a-camera primitive and having issues. You need to disable look-controls and wasd-controls that is auto added by the a-camera primitive or just use a-entity with camera, see my comments on #331 (comment)
from superframe.
You're the second person that use the a-camera primitive and having issues. You need to disable look-controls and wasd-controls that is auto added by the a-camera primitive or just use a-entity with camera, see my comments on #331 (comment)
Prefect, I have used a-entity in my projects before.
I solved the problem by look-controls=”enabled: false“
and wasd-controls="enabled: false"
.
What is the reason ? Although I turned on wasd, but I didn't operate the keyboard. Can't we solve this problem by adding attributes to element in our orbit-controls?
This new code:
<a-entity
id="camera"
camera="fov: {fov}"
look-controls="enabled: false"
wasd-controls="enabled: false"
orbit-controls="target: 0 0 0; minDistance: 2; maxDistance: 180; initialPosition: 0 0 -20; rotateSpeed: 0.5"></a-entity>
from superframe.
The issue is that look-controls and wasd-controls is moving the entity object3D (THREE.Group instance), orbit-controls is moving the camera object that is a child of the entity object3D. look-controls and orbit-controls are registering both handlers for mouse movement.
from superframe.
The issue is that look-controls and wasd-controls is moving the entity object3D (THREE.Group instance), orbit-controls is moving the camera object that is a child of the entity object3D. look-controls and orbit-controls are registering both handlers for mouse movement.
My idea is whenther in the orbit-controls
component, the init method can push this.el.setAttr('look-controls', 'enabled: false')
in the next eventloop to solve this problem.
This avoids the need for additional configuiration every time we use it. There is a certain conflict between our orbital camera and look controls and look-controls
and wasd-controls
.
Of course this is just an idea, I'm not sure if it can be implemented , I will try it during non-working hours.
I tried it and found that I can solve the problem by adding setAttr to init. See code commit above.
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] Conflicts with TransformControls 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.