PDA

View Full Version : how to pass different vertices to draw a polygon



shilpa
11-30-2009, 09:00 PM
hi,
can you please tell me how to draw a polygon with the below data.

BEGIN_POLYGON 0 0 6
BEGIN_WINDING
POLYGON_POINT 70.24624819 21.00000000 0.00000000 0.00614939 0.00575265 19.00000000
POLYGON_POINT 70.24479095 20.99854086 0.00000000 0.00596628 0.00633249 19.00000000
POLYGON_POINT 70.24291600 20.99708171 0.00000000 -0.00614939 0.01396201 19.00000000
POLYGON_POINT 70.24041543 20.99541657 0.00000000 0.02415503 0.00770581 19.00000000
POLYGON_POINT 70.23982414 20.99524109 0.00000000 0.03953613 0.06507973 19.00000000
POLYGON_POINT 70.23899062 20.99440757 0.00000000 0.01792935 0.03706416 19.00000000
POLYGON_POINT 70.23791485 20.99374952 0.00000000 -0.02180514 0.08714427 18.00000000
POLYGON_POINT 70.23687343 20.99437324 0.00000000 -0.22130159 0.19765011 18.00000000
POLYGON_POINT 70.23654345 20.99492638 0.00000000 -0.40877394 0.22896162 18.00000000
END_WINDING
END_POLYGON
in this i should take last 3 co-ordinates (x,y,z) to draw a polygon.sry for asking this type of ques.

AdrianPi
12-01-2009, 09:18 AM
You need to tesselate the polygon into triangles first prior to drawing. If you are targeting OpenGL 1.x or 2.x, you can use GLUT for that.

shilpa
12-01-2009, 08:46 PM
k thank you.