You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, September 16th 2010, 5:08pm

zoom in by left click

Hello , i want to know-if is possible to zoom in by one click, just like the + key but with the left key of the mouse ?? Like that the zoom go to the cursor ?

I try to find on the forum but no answer , just the discussion about double click to zoom

Thanks a lot !!

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Friday, September 17th 2010, 8:21am

Hi toutcoolpedro,

Here a "zoom in by left click" code based on Klaus code :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	<events onmousedown="copy(lastmx,mouse.x);
                     	copy(lastmy,mouse.y);"
        	onmouseup="if(lastmx == mouse.x,
                      	if(lastmy == mouse.y,
                         	mul(tofov,view.fov,0.5);
                         	if(tofov LT view.fovmin, copy(tofov,view.fovmin));
                         	screentosphere(mouse.x,mouse.y,toh,tov);
                         	adjusthlookat(get(toh));
                         	tween(view.hlookat,get(toh));
                         	tween(view.vlookat,get(tov));
                         	tween(view.fov,get(tofov));
                         	);
                      	);
                    	"
        	onmousewheel="stoptween(view.hlookat,view.vlookat,view.fov);"
        	onkeydown="events.onmousewheel();"
        	/>


SAlut.

3

Friday, September 17th 2010, 12:29pm

Thanks a lot Michel, i will try, you are the ghost in this forum, alway trying to find solution !! Perfect. Big thanks !!
I's working perfectly like i want !!

This post has been edited 2 times, last edit by "toutcoolpedro" (Sep 17th 2010, 4:05pm)


perspixe

Trainee

Posts: 64

Location: Bologna, Italia, Vancouver, BC

  • Send private message

4

Monday, July 30th 2012, 6:02pm

Hi toutcoolpedro,

Here a "zoom in by left click" code
SAlut.


Salut Michel

I tried this code and it works fine except for 2 things:
-I have a high resolution panorama for a painting that is about square, so a flat panorama set up in fullrange.
When I am completely zoomed out and I zoom in by a click somewhere by the sides (not necessarily completely on the sides), the zoom has a very unelegant jump that is due, I guess, to the fact that as it is trying to zoom in directly to that spot it reaches the edges of the image too fast, and thus can't carry on recentering to the clicked point and jumps back and scatter around a bit. Not really sure what's going on actually. Once we are already zoomed in somewhere it doens't do that anymore.
-I find the speed of zoom a bit fast (not the amount: 0.5 is fine), can I change that?
-Is there a way to zoom not exactly to the clicked point but to a point in between - I guess in between current center and clicked point, but being able to change it with a 0.0 to 1.0 parameter would be excellent for testing best movement.

xxGreg

Similar threads