#1
|
|||
|
|||
Mouse zoom
I am using camera = vizcam.PivotNavigate(center=[0, 2, 2], distance=2.5)
The mouse wheel reduces the zoom factor exponentially as I zoom into some object. How do I make it stop or change this behavior? |
#2
|
|||
|
|||
Create your own class that inherits from PivotNavigate and override the mouse wheel behavior:
Code:
class MyPivotNavigate(vizcam.PivotNavigate): def _camMouseWheel(self,e): # Compute new distance base on mouse wheel dist = self.getDistance() - e.dir # Make sure distance does not drop below zero dist = max(dist,0.01) # Apply new distance self.setDistance(dist) cam = MyPivotNavigate() |
#3
|
|||
|
|||
Hi,
Is there a way to override mouse wheel in the Panorama Camera class? All I want is a Panorama Camera with the zoom in and zoom out capabilities. Best regards, Alex. |
#4
|
|||
|
|||
Solved. Changing the Field of View is enough for my purposes.
For those who care: Code:
def onMouseWheel(dir): if dir == 1: viz.fov(40,1.3333) else: viz.fov(70,1.3333) viz.callback(viz.MOUSEWHEEL_EVENT,onMouseWheel) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Warning mouse() -> Set mouse() of window | johannes2 | Vizard | 1 | 08-19-2010 02:11 PM |
how to remove velocity when mouse is disabled? | jvacare1 | Vizard | 2 | 02-18-2010 10:25 AM |
Navigating an avatar using mouse position(2D) in 3D environment | james007 | Vizard | 1 | 10-16-2009 11:29 AM |
Mouse problem | steve | Vizard | 7 | 07-14-2005 03:01 PM |
Draw Line between Points selected by mouse | Johannes | Vizard | 7 | 01-07-2005 02:50 PM |