WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-08-2010, 12:58 PM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
Question 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?
Reply With Quote
  #2  
Old 10-08-2010, 01:18 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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()
Reply With Quote
  #3  
Old 05-04-2012, 08:06 AM
kovitch kovitch is offline
Member
 
Join Date: Sep 2010
Posts: 30
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.
Reply With Quote
  #4  
Old 05-04-2012, 10:02 AM
kovitch kovitch is offline
Member
 
Join Date: Sep 2010
Posts: 30
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)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 06:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC