View Full Version : Need some help about picking (it's very important)
04-04-2000, 11:11 PM
I have an important project to realize, a CAD file viewer like *.STL. But even if I have already done the model visualisation, I must now implement selection of face (and probably vertex and lines). So I need some help about the picking technic. First my objective is to change color of selected faces.
Thanks to all who can help me.
PS: Sorry for my bad english but i'm french http://www.opengl.org/discussion_boards/ubb/wink.gif
The easiest method that I know of doing selection is the one outlined in the OpenGL Redbook. I.e. encode identifiers for your objects as rgba values and draw the scene using these encoded values as the colors, but do not swap buffers. Then, when the user clicks at a point, you can grab the rgba value at the mouse point from the back buffer, decode the color and get back to your object identifier.
04-05-2000, 11:37 AM
I thank U very much. But I have a problem, my mesh is a CAD model and have no color (it musn't use color -> the client is king).
I have heard a technic which consist in creating a line (Z axis parallel) and select all the faces which intersect with this line.
I wonder now how know which are these faces.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.