Click here to Skip to main content
16,005,290 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: serial port sniffer ( spy or monitor) Pin
Cedric Moonen2-Mar-06 3:12
Cedric Moonen2-Mar-06 3:12 
AnswerRe: serial port sniffer ( spy or monitor) Pin
Rick Crone2-Mar-06 10:45
Rick Crone2-Mar-06 10:45 
AnswerRe: serial port sniffer ( spy or monitor) Pin
mikanu5-Mar-06 11:36
mikanu5-Mar-06 11:36 
Questionopengl point selection Pin
giotis821-Mar-06 23:03
giotis821-Mar-06 23:03 
AnswerRe: opengl point selection Pin
Ingo2-Mar-06 2:37
Ingo2-Mar-06 2:37 
GeneralRe: opengl point selection Pin
giotis822-Mar-06 2:46
giotis822-Mar-06 2:46 
GeneralRe: opengl point selection Pin
Ingo2-Mar-06 2:59
Ingo2-Mar-06 2:59 
AnswerRe: opengl point selection Pin
El Corazon2-Mar-06 10:13
El Corazon2-Mar-06 10:13 
There are several ways to do this. The "hit test" implies solid shapes, or triangles. This is because points and lines are one dimensional objects. A triangle has a 2D surface projected in a 3D environment, but when the surface is shown to the user, it occupies enough space on the screen to be selected and chosen. Although you can draw a triangle as a wire-frame, you will want to store the data as triangles rather than points or lines.

It seems there is even a Code Project article on it: http://www.codeproject.com/opengl/openglmousesellection.asp[^]

You can also save yourself the math in your 2D to 3D projection idea by using the glProject() and glUnProject() routines. By comparing the results with your mouse location you can do "nearest" operations which are a little more complicated since they imply distance operations.

You can shortcut some series, by using a culling sphere concept (center of object), and finding the overlapping cull spheres, by checking distance to center and radius of sphere to distance. When the chosen point is within the cull sphere, then and only then will you parse through the full object to find which point. You can also do similar operations with faces with center and range operations, though that will more likely take longer then applying other methods.

If you do a google search on "opengl picking" or "opengl mouse picking" you will find lots on the subject from various sources.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)


-- modified at 16:13 Thursday 2nd March, 2006
GeneralRe: opengl point selection Pin
Ingo2-Mar-06 23:08
Ingo2-Mar-06 23:08 
GeneralRe: opengl point selection Pin
El Corazon3-Mar-06 3:56
El Corazon3-Mar-06 3:56 
QuestionUsing app.config Pin
Red Stateler28-Feb-06 4:49
Red Stateler28-Feb-06 4:49 
AnswerRe: Using app.config Pin
George L. Jackson28-Feb-06 9:44
George L. Jackson28-Feb-06 9:44 
GeneralRe: Using app.config Pin
Red Stateler28-Feb-06 9:53
Red Stateler28-Feb-06 9:53 
Question[Message Deleted] Pin
Harrison Ford26-Feb-06 21:55
Harrison Ford26-Feb-06 21:55 
AnswerRe: How to convert a decimal value to a hexadecimal value? Pin
Cedric Moonen26-Feb-06 22:11
Cedric Moonen26-Feb-06 22:11 
General[Message Deleted] Pin
Harrison Ford26-Feb-06 22:19
Harrison Ford26-Feb-06 22:19 
GeneralRe: How to convert an integer value to a hexadecimal value? Pin
Cedric Moonen26-Feb-06 22:24
Cedric Moonen26-Feb-06 22:24 
GeneralRe: How to convert an integer value to a hexadecimal value? Pin
toxcct27-Feb-06 0:04
toxcct27-Feb-06 0:04 
GeneralRe: How to convert an integer value to a hexadecimal value? Pin
Peter Charlesworth28-Feb-06 8:05
Peter Charlesworth28-Feb-06 8:05 
AnswerRe: [Message Deleted] Pin
Peter Charlesworth27-Feb-06 2:14
Peter Charlesworth27-Feb-06 2:14 
GeneralRe: [Message Deleted] Pin
toxcct27-Feb-06 6:23
toxcct27-Feb-06 6:23 
GeneralRe: [Message Deleted] Pin
Peter Charlesworth27-Feb-06 6:46
Peter Charlesworth27-Feb-06 6:46 
GeneralRe: [Message Deleted] Pin
toxcct27-Feb-06 6:47
toxcct27-Feb-06 6:47 
QuestionGet 3rd character. Pin
foolygoofy2626-Feb-06 9:21
foolygoofy2626-Feb-06 9:21 
AnswerRe: Get 3rd character. Pin
Christian Graus26-Feb-06 10:03
protectorChristian Graus26-Feb-06 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.