View Full Version : snap objects in OpenGL ?
12-08-2002, 07:45 PM
How do the program know about the points or planes that we need to select them by mouse?
12-09-2002, 12:03 AM
The program doesn't know unless you code it in. If you have already implemented mouse selection of objects that you render then you can re-use the selection methods to programmatically "snap" the object to any point when the mouse button is released.
You can optimise the speed by only allowing specific objects to snap together. For example, objects that I render have certain control points that I can select and drag around. So, no matter what kind of object I am working with I only need to render the control points with my selection method to see if I need to snap to anything nearby.
12-09-2002, 12:07 AM
I just read your post again. The topic isn't directly related to the question that you asked in the post.
Do you want to know about selection or snapping?
To snap, you can re-use the tools that you use for selection. Selection itself is a bit harder. Which is it that you want to know about?
12-10-2002, 06:14 PM
Thank you very much for your suggestions.
I would like to create an application that has the "snapping" like Sketch UP Program. I hope that you have ever seen that program before.
If I have 2 WireCubes (small one is in the big one) when I move the small one , I need the snapping active for help me locate any the coner of the small cube attach into big one at the coner or the edge too .
please help me again. thanks a lot
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.