const camRadiusTilStart = 60 // Camera radius (i.e zoom) at which the tilt effect beginsĬonst camRadiusTiltEnd = 10 // Camera radius at which the tolt reaches its maximumĬonst cameraBetaStart = camera.beta // Controls the tilt effect when camera is zoomed outĬonst cameraBetaEnd = camera.beta * 2. It modifies the camera’s beta property based on its radius (i.e the current zoom level). Hi a solution that uses the onBeforeRenderObservable to run an update loop. These are just a couple of things that come to mind so hopefully, this gives you a starting place. If you want to that behavior to be with left-click instead, you could just change your attachControl call to something like // First param doesn't matter, second is for noPreventDefault, third is for using ctrl for panning, and the fourth is to change your panning button to left clickĬamera.attachControl(canvas, true, false, 0) įor adding a limit, you may need to either use a custom solution that checks for the target’s position before moving or possibly add an observer/callback to one of the camera’s observables like onViewMatrixChangedObservable to zero out the inertialPanningX and/or inertialPanningY values if the target gets to a specific boundary (these inertial panning values are used to smoothly move the camera with inertia if input is received zero-ing them is effectively the same as cancelling any remaining movement). By default, panning is handled with a Right-click drag. You can also use your upper and lower beta limits to prevent the camera from moving to an undesired angle.įor panning, the ArcRotateCamera does have built-in panning and I believe also has a flag for map panning, which should eliminate any vertical movement. You could even use a Scalar.Lerp to a smoother transition. The tilting as you zoom in could be as simple as modifying your camera’s beta with respect to your camera’s radius. Rather, the control might better be labeled "Track" or "Dolly" which implies that the viewer is actually moving forward and backward, similar to the "Pan Left/Right" effect.Since you’re using an ArcRotateCamera, it shouldn’t be too difficult to accomplish what you’re trying to do. Zooming implies that the viewer stands in place and the angle of view narrows or widens. I realize this sounds silly, but it's very different from, say, industrial design, where there may not be a definite "Up/Down" orientation with regard to one's work.įor the record, the 3D Connexion control "Zoom" in SketchUp (and Google Earth for that matter) does not actually zoom. Thus, having the "gravitational control" restricted to a single controller seems to make more sense to me. I think the main reason the Google Earth control config makes sense to me is due to the fact that I'm in Architecture, and most of my work is rooted by gravity. Yes, I can move around, but the Z-axis control is not restricted to the "Pan Up/Down" control. I've seen this query before, and I'll go ahead and submit this post on the SketchUp forum as well.Ĭan you "move around" in SketchUp when in "camera mode"? In other words, can you get closer to and away from objects? It doesn't really give me what I want though.Īnd yes I realize that SketchUp and Earth are different applications with different teams of designers and engineers and developers, etc. I've also enabled "Dominant," which is handy as a kind of training mode. Instead, it fixes the user's position, and the controls then become the means whereby the user "looks around" the 3D environment, similar to "Look Around" in Sketchup. I've tried Camera mode: it does not accomplish what I'm after. Likewise, "Roll" is disabled in both.) This seems to be a much more intuitive arrangement. ("Tilt" and "Spin" are the same in both applications. In Google Earth, the "Pan Up/Down" control affects only the Z-axis, no matter what your viewing angle, while the "Pan Right/Left" and "Zoom" controls affect only the user's position in the X/Y plane. However, whichever you choose, the alternate control acts as a pan control (similar to "Pan Right/Left"), without restricting movement along the Z-axis. In SketchUp, the user can select either the "Pan Up/Down" or "Zoom" control to affect the distance between the user and his work. Make use of Google Earths detailed globe by tilting the map to save a perfect 3D view or diving into Street View for a 360 experience. Is there any way to make the 3D controller behave the same way in SketchUp as it does in Google Earth?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |