I tried your suggestions, and I think it should work. It's probably quite obvious what I'm doing wrong, but I'm inexperianced with vertex colouring. The vertex selecting seems to work, according to a simple test I ran, but I can't see their colours with the vertex colouring. Can you help me please? Am I supposed to set up the 3d model for vertex colouring?
;selecting polygons
;NOTE: CURRENTLY, YOU CAN ONLY SUPPORT SELECTION OF SINGLE OBJECTS BECAUSE THE PICKED POLYGON IS
;STORED IN A VARIABLE. MAKE THE BELOW VARIABLE AN ARRAY OR DATABANK OR TYPE INSTANCE
If MouseDown(1) ;if the user left clicks
;camera click where the mouse is to selec the vertex
CameraPick camera,MouseX(),MouseY()
;check if a proper entity is being clicked on.
;Without this, you'll get a memory access violation
If Not PickedEntity() = 0
;save the picked triangle in a variable
;NOTE: THIS IS WHAT YOU WOULD ALTER TO ALLOW FOR MULTIPLE SELECTIONS...
tri = PickedTriangle()
;find the picked surface to allow for vertex finding
surface = PickedSurface()
;find vertices attached to the selected surface
;NOTE: this section should be moved out of here and in to where it's used
;otherwise you'll have to go through piles of junk with storing this for no reason
tri_vertex0 = TriangleVertex(surface,tri,0)
tri_vertex1 = TriangleVertex(surface,tri,1)
tri_vertex2 = TriangleVertex(surface,tri,2)
;the the vertex colouring. Deosn't work yet...
;FIX THIS YOU IMBECILE, DYLAN
VertexColor surface,tri_vertex0,255,0,0,1
VertexColor surface,tri_vertex1,255,0,0,1
VertexColor surface,tri_vertex2,255,0,0,1
EndIf
EndIf
Erm, I hope you don't mind my methods of making a todo list. The more of those mean comments I remove, the happier I am; it's quite effective actually.
|