## News:

*NEW* Current Version on STEAM16.026
Logfile: EN, DE

Webchat:
Visit the chat

## 3D - PolyCircle

#### backslider

Hi guys,

I wrote a little function to draw a Polyvector circle in the 3D world.
You can only draw it on the z-axis = 0, but it's really cool.

Code (glbasic) Select
`LOCAL rotationZ# = 0WHILE TRUECLEARSCREEN RGB(0xff, 0xff, 0xff) Make3D() INC rotationZ, 1 IF rotationZ > 360 THEN rotationZ = 0 PolyCircle3D(-6, 2, 4, rotationZ/2, RGB(0xbc, 0xf8, 0x94), 90) PolyCircle3D(2, 5, 3, rotationZ, RGB(0xff, 0x8c, 0x8c), 45) PolyCircle3D(-8, 10, 3, rotationZ*2, RGB(0x78, 0x6f, 0xee), 1)SHOWSCREENWENDFUNCTION Make3D: X_MAKE3D 1, 1000, 45 X_CAMERA 25,25,25,0,0,0 X_AMBIENT_LT 0, RGB(0xff, 0xf9, 0xea) X_DRAWAXES 0,0,0ENDFUNCTION//Draw a 3D circle with this amazing function xDFUNCTION PolyCircle3D: posX#, posY#, diameter#, rotationZ#, col%, _step%=1 STARTPOLY -1, 0 FOR i%=0 TO 360 STEP _step //_step=1 -> full detail POLYVECTOR posX + COS(i - rotationZ) * diameter, posY + SIN(i - rotationZ) * diameter, 0, 0, col NEXT ENDPOLYENDFUNCTION`

cheers
backslider

#### bigsofty

Always nice to see a new snippet! Thank you!
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)