News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

shape vertices

Started by Alex777, January 19, 2006, 03:40:29 PM

Previous topic - Next topic

Alex777

I believe the x,y positions of vertices 3 & 6 are being reported incorrectly for convex shapes.  This code will show what I mean:


CreateConvexShape 1, 46, 6
; should return 0:
Print GetShapeVertexY(1, 3)
; should return 0:
Print GetShapeVertexY(1, GetShapeEdge(1, 3, 0))
; should return 46:
Print GetShapeVertexX(1, 6)
; correctly returns 46:
Print GetShapeVertexX(1, GetShapeEdge(1, 6, 0))
Sync
WaitKey

kevin

Vertex indexes are zero inclusive.


CreateConvexShape 1, 46, 6

For vert=0 to 5
dot 400+GetShapeVertexX(1, vert),300+GetShapeVertexY(1, vert)
print Vert
print GetShapeVertexX(1, vert)
print GetShapeVertexY(1, vert)
next

Sync
WaitKey


Alex777

Ooops.  thanks, Kevin!