From f4b2959ea48682a3fb59d23cfdfd40fbce44d3ae Mon Sep 17 00:00:00 2001 From: slevy <slevy> Date: Sat, 17 Feb 2001 17:44:05 +0000 Subject: [PATCH] For polygons, rotate circle of vertices by 1/2 step. Then, for "polysides 4" and "txscale .707", the vertices coincide with the corners of the 0..1 texture. --- src/partibrains.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/partibrains.c b/src/partibrains.c index 2dd9947..66b3a80 100644 --- a/src/partibrains.c +++ b/src/partibrains.c @@ -1,6 +1,11 @@ static char local_id[] = "$Id$"; /* * $Log$ + * Revision 1.22 2001/02/17 17:44:05 slevy + * For polygons, rotate circle of vertices by 1/2 step. + * Then, for "polysides 4" and "txscale .707", + * the vertices coincide with the corners of the 0..1 texture. + * * Revision 1.21 2001/02/17 05:39:45 slevy * Allow (in data language) "object gN=NAME". * @@ -1454,7 +1459,7 @@ void sortedpolys( struct stuff *st, struct specklist *slhead, Matrix *Tc2wp, flo /* Build prototype fan -- unit disk in screen plane */ for(i = 0; i < nfan; i++) { - float theta = 2*M_PI*i/nfan; + float theta = 2*M_PI*(i+.5f)/nfan; xyfan[i][0] = cos(theta); xyfan[i][1] = sin(theta); vcomb( &sfan[i], xyfan[i][0] / scl, (Point *)&Tc2w.m[0*4+0], @@ -1654,7 +1659,7 @@ void drawspecks( struct stuff *st ) if(st->npolygon > MAXXYFAN) st->npolygon = MAXXYFAN; nxyfan = st->npolygon; for(i = 0; i < nxyfan; i++) { - float th = i*2*M_PI / nxyfan; + float th = (i+.5f)*2*M_PI / nxyfan; xyfan[i][0] = cos(th); xyfan[i][1] = sin(th); } -- GitLab