react-whs
react-whs copied to clipboard
OrbitControlsModule doesn't seem to work
Hi there, thanks for this cool library. Very appreciated.
I'm trying to get the OrbitControlsModule to not zoom or simply maxZoom or maxDistance. None of these below properties worked when injecting this module in my <App>
. What am I doing wrong?
new WHS.OrbitControlsModule({
// enableZoom: false
// follow: false,
// minDistance: 3,
// maxDistance: 3,
// minZoom: 3,
// maxZoom: 3,
// enableDamping: true
})
Thank you
Hi, thanks! Try to use .controls property of OrbitControlsModule, it has a THREE.OrbitControls that should have enableZoom property
On Sun, Nov 11, 2018 at 11:35 PM Albert Peiró [email protected] wrote:
Hi there, thanks for this cool library. Very appreciated. I'm trying to get the OrbitControlsModule to not zoom or simply maxZoom or maxDistance. What Iam I doing wrong? new WHS.OrbitControlsModule({ // enableZoom: false // follow: false, // minDistance: 3, // maxDistance: 3, // minZoom: 3, // maxZoom: 3, // enableDamping: true }) Thank you
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WhitestormJS/react-whs/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AHTX1TnVVAM5LC2iUJmKWIXiTh-lkmMNks5uuJgygaJpZM4YYsvm .
I'm importing WHS like this:
import * as WHS from "whs";
import * as THREE from "three";
So WHS.controls is not available. In my case everything works like this:
WHS.SceneModule(),
new WHS.CameraModule(
It does work without accessing .app or .controls. Problem is in the case of OrbitControlsModule it just completely ignores the properties - not sure why - the other examples and modules work perfectly.
Thanks Alex.
On Mon, 12 Nov 2018 at 00:06, Alexander Buzin [email protected] wrote:
Hi, thanks! Try to use .controls property of OrbitControlsModule, it has a THREE.OrbitControls that should have enableZoom property
On Sun, Nov 11, 2018 at 11:35 PM Albert Peiró [email protected] wrote:
Hi there, thanks for this cool library. Very appreciated. I'm trying to get the OrbitControlsModule to not zoom or simply maxZoom or maxDistance. What Iam I doing wrong? new WHS.OrbitControlsModule({ // enableZoom: false // follow: false, // minDistance: 3, // maxDistance: 3, // minZoom: 3, // maxZoom: 3, // enableDamping: true }) Thank you
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WhitestormJS/react-whs/issues/17, or mute the thread < https://github.com/notifications/unsubscribe-auth/AHTX1TnVVAM5LC2iUJmKWIXiTh-lkmMNks5uuJgygaJpZM4YYsvm
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WhitestormJS/react-whs/issues/17#issuecomment-437714056, or mute the thread https://github.com/notifications/unsubscribe-auth/AB5HjQt2uVa0Hr3uk6nYZ3sPkf3WNzxqks5uuK2OgaJpZM4YYsvm .
-- Albert Peiró
This is how my app looks like:
<App
refApp={this.appRef}
modules={
[
// new WHS.ElementModule(),
new WHS.SceneModule(),
new WHS.CameraModule({
position: new THREE.Vector3(0, 5, 11),
fov: 75,
aspect: width / height
}),
new WHS.RenderingModule(
{
bgColor: 0xfff,
bgOpacity: 1,
renderer: {
alpha: true,
antialias: true,
shadowmap: {
type: THREE.PCFSoftShadowMap
}
},
width,
height
},
{ shadow: true }
),
new WHS.OrbitControlsModule({
enableZoom: false
// follow: false,
// minDistance: 3,
// maxDistance: 3,
// minZoom: 3,
// maxZoom: 3,
// enableDamping: true
})
]
// new WHS.ResizeModule()
}
>
...
And it works like that. But the zoom or any other feature of OrbitControls is ignored. The controls do work though, just with the default values.