Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Sa Jun 08, 2024 18:39

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Do Apr 15, 2004 19:25 
Offline
DGL Member
Benutzeravatar

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.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Apr 15, 2004 20:54 
Offline
DGL Member

Registriert: Do Mai 30, 2002 18:48
Beiträge: 1617
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.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Apr 19, 2004 09:55 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Dez 13, 2002 12:18
Beiträge: 1063
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 :wink: .

_________________
Viel Spaß beim Programmieren,
Mars
http://www.basegraph.com/


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

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.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.162s | 15 Queries | GZIP : On ]