View Full Version : code using gl/glut

04-29-2017, 02:52 PM
can u help me with the code how to draw multiple 3d objects(any) where ever I click on the screen? Because I'm implementing Dijkstra's algorithm so, I need to place nodes where ever I click:)using mouse coordinates

Dark Photon
05-04-2017, 06:38 AM
pavankumarm, I deleted your post from yesterday, as it is an exact duplicate of this one.

You also have 2 other threads besides this one (and the deleted one) open on this same exact topic:

* program that draws a erasable rectangle based on the movement of the mouse (https://www.opengl.org/discussion_boards/showthread.php/199506-program-that-draws-a-erasable-rectangle-based-on-the-movement-of-the-mouse)
* opengl->glut-> draw spheres where mouse pointer is clicked (https://www.opengl.org/discussion_boards/showthread.php/199499-opengl-glut-draw-spheres-where-mouse-pointer-is-clicked)

The problem with this thread (and the deleted one) is that you're not asking specific OpenGL or OpenGL-related technical questions. You can look up one of many GLUT tutorials on the net and you'll be able to find out how to use GLUT mouse button (https://www.opengl.org/resources/libraries/glut/spec3/node50.html) and motion (https://www.opengl.org/resources/libraries/glut/spec3/node51.html) callbacks. Start with those. I've already suggested this to you in other threads. See what OpenGL-related questions develop from that, and then ask those specific questions. Folks here aren't going to implement your homework for you.

And if you do post some code (as you have before), don't just post it and say something like "it doesn't work". Tell folks what you've tried to do to analyze and debug the problem, and ask specific OpenGL-related questions that have come up as a result of that investigation. This isn't a debugging service. Folks will help you if you show that you're actually trying to do this yourself. But we're not going to implement it for you.

Finally, please read The Forum Posting Guidelines (https://www.opengl.org/discussion_boards/showthread.php/176139-Forum-Posting-Guidelines?p=1230021&viewfull=1#post1230021). I think they'll help you going forward.