|
Re: Zoom with mouse wheel
[Re: Icarni]
#321948
05/03/10 19:25
05/03/10 19:25
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Hm, you are aware that you are not actually zooming but scaling two objects at one of their axis?
"Zooming" in the sense of filming or photographing is when you change the camera.arc by mickey.z.
In game "zooming" often refers to moving the camera nearer or farer away:
VECTOR* temp = {x=0;y=0;z=0;} var camera_distance = 100;
function zoom() { while(1) { vec_for_angle(temp, camera.pan);//translates an angle into a direction vec_scale(temp, camera_distance);//sets a distance to the direction vec_add(temp, camera.x);//places the directed distance to the cameras posisiotn camera_distance += (mickey.z*10*time_step); if(mouse_left){camera.pan += mouse_force.x;} wait(1); } }
Last edited by Pappenheimer; 05/03/10 19:35.
|
|
|
Re: Zoom with mouse wheel
[Re: Icarni]
#321955
05/03/10 20:13
05/03/10 20:13
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Scaling all objects is a valid approach. However, keep in mind you have to transform the objects positions as well.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|