Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I know how to do picking using names. But how do i pick an individual face or even vector? Name everyone of them? Seems a lot of overhead.
Are there any smarter ways doing such a thing? Thanks in advance.
this depends on how you are storing your data.. say you have stored your faces in an array - you could use the array indices for names and then easily determine which face was hit. if you use objects(or pointers) you could use their adresses as names and after clicking you could recast them.
if you want to select vertices/vectors you have some more work to do. you must decide how you can make your vertices/vectors clickable. there may be special zones for that - in 3ds max there are these small quads when you are in vertex mode. the rest you could do as mentioned before.
for the overhead:
make your piking in several stages: which object has been clicked - no more information but object IDs passed to opengl. then you should take care of the "selction mode" you're in: faces or vertices (objects could also be one - then your gui would be very consistent) -> send only the naming information for the selected object to opengl and determine then which face/vertex/... has been picked.
Code the indices of your faces/edges/whatever into RGB values (use only five bit for every color to support 16 bit modes - 32767 indices should be enough, else you could do multipass), draw the object with the appropriate colors (for every face, line) and read back the pixel under the cursor - much faster than selection mode, which usually takes place in software - but of course you can only select "visible" elements, if you don't use layers (which is probably what you want anyway)
Since this takes place in the back buffer, nobody will see, what you are doing .
Mitglieder in diesem Forum: 0 Mitglieder und 13 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.