I saw here Click to zoom in WebGL how to zoom in to a particular point. How can I reverse that functionality- i.e. zoom out?
Asked
Active
Viewed 4,727 times
1 Answers
1
Change the statement
vec3.subtract(eye,dir) ;
to
vec3.add(eye,dir) ;
This moves the eye in the opposite direction from before.
Here's the modified live example: http://jsfiddle.net/3wwdU/1/

brainjam
- 18,863
- 8
- 57
- 82
-
Thanks brainjam. That was really helpful. Since you seem quite knowledgeable on the subject, can you point me in the direction of a page which explains how to identify a 3d point from screen coordinates (user input)? – yelan Jun 01 '11 at 10:54
-
@yelan,You might find this answer useful - http://stackoverflow.com/questions/5613718/click-to-zoom-in-webgl/5616743#5616743 – brainjam Jun 01 '11 at 14:44