I use gluUnProject to lay the beam on the scene and add the primitive there. What I'm trying to do is now select exactly the existing primitives, so if I have 3 spheres, I could click on one to delete it.
I think the decision will somehow check if the ray intersects the object and checks if it is closest to the beginning of the cast. My solution is still primitive and surrounds all objects with a bounding cube, anyway it's easy to do it exactly for spheres, using:
does the ray intersect with ( object)
or
returnRayIntersections(ray);
The last thing I use OpenGL with GLUT.
Thanks to everyone, Laurence
OpenGL :
, , . 24- , # 000001, # 000002 .. , .., , , , .
( glSwapBuffers). glReadPixels back-buffer GL . , , . , , ( # 000001, # 000002 ..).
. , , GL_SELECTION. 3D- , , , , . GL , . , 3D-, , , .
OpenGL - , , . , : GL :
glRenderMode (GL_SELECT);
, , . .
Nehe , .
Source: https://habr.com/ru/post/1726950/More articles:Python Encapsulate the Print function for a variable - pythonPolicyException when using the DotNetOpenAuth library - asp.netEmacs disables modes - emacsCall currentModalViewController twice? - iphoneGetting error when initializing Membership.Provider for the first time after restarting the application - c #CSS Border RADIUS, which is the right style to use? border radius? -webkit-border radius? -moz is the border of the radius? - cssHow to set item in DropDownList as default value? - c #Heap Interlace Error - c ++how to get the identifier of the audio device to transmit to NSSound setPlaybackDeviceIdentifier: - macosObjective-C memory leak confusion - objective-cAll Articles