Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Mouse click to zoom on object

  1. #1
    Newbie Newbie
    Join Date
    Dec 2017

    Question Mouse click to zoom on object

    Hey guys,im just learning OpenGL, i make our solar system with modern OpenGl, i wanna make the planet zoom in when i click it with mouse but i stuck there, can anyone help me?

    * sry for my bad english

  2. #2
    Junior Member Newbie
    Join Date
    Dec 2017
    This is a very tricky matter on any 3d application where all 3 axis are used in order to represent when a mouse is at. You have many options at this point. 1 create an image of the environment at that time and test for colors within the plane ( This was actually a very useful tool especially during the 8 bit operations of the NES - see Duck Hunt for examples ). You can triangulate the direction behind the mouse and test for objects within that spacing. Or you can assign an (bottom,left,top,right) screen coordinate system for the objects in the solar system that approximate with screen x,y. The latter will probably be the most versatile but representing the x,y in pixels will be effected drastically by the monitor size and resolution settings so it is imperative that you designate it by system. I forget the exact process but if I do remember correctly it can be tied into the FOV system to get the values correctly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts