playMaker

Author Topic: right mouse button clicked to zoom function  (Read 2329 times)

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
right mouse button clicked to zoom function
« on: September 10, 2013, 06:37:30 PM »
I am trying to make a zoom function of a camera by clicking the right mouse button and them moving the mouse over the Y axis . The problem is that with fov function is not working.

Any ideas ? Thanks in advance ...

parallel

  • Full Member
  • ***
  • Posts: 155
Re: right mouse button clicked to zoom function
« Reply #1 on: September 10, 2013, 07:16:19 PM »
The below setup works- the listen state just has a 'Get mouse button down'

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
Re: right mouse button clicked to zoom function
« Reply #2 on: September 10, 2013, 08:51:57 PM »
Thats very nice thanks... :)

do you know how to limit it to  min - max to avoid super zoom / out ?

I tried float clamp but then mouse pointer works only on a limited area of the screen (for example from pixels 90 to 150). If the mouse pointer (y axis) is over 150 pixel or less tan 90 pixel is not working.

Any ideas ?
« Last Edit: September 10, 2013, 09:19:15 PM by cmvrgr »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: right mouse button clicked to zoom function
« Reply #3 on: September 11, 2013, 02:47:07 AM »
Hi,

 you need to have a bit more work here. Because you need to constraint the camera position. So get the distance between the target and the camera, that's the float you need to watch. And if it goes out of bound, simply stop affecting the zoom. That's how I do it.

 if you want to use clamping, then you need to get that z distance, clamp it, and then reassign it to the camera z position.

 Bye,

 Jean