-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|687|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




Phoenix

Iterating edges of a polygon

25th February 2010

This is neat and trivial trick I found the other day which is useful when you want to iterate through consecutive pairs of vertices (edges) of a polygon. [tt]i[/tt] is the index of the first vertex, and [tt]j[/tt] is the index of the following vertex.
[co*snip*


Phoenix

Fast inverse square root

29th June 2009

Found this while browsing about the net, and I thought it could be useful (or at least an interesting read). Lengthy explanation, for the mathematically inclined.
[code]
float InvSqrt(float x){
float xhalf = 0.5f * x;
int i = *(int*)&x; // st*snip*


Phoenix

Find powers of two

1st May 2008

Took me quite a while to figure out how to do find out if a number is a power of two without having lots of bells and whistles. Not sure if it's the fastest way, but it sure is small.
[code]
bool Po2(int n) {
return n <= 0 ? false : (((n-1) & n*snip*


Phoenix

3D in 2D Cube

20th March 2008

A classical and simple 3D effect made in 2D


Phoenix

Sine Lines

12th December 2006

An old effect I found on my computer

More - Older Posts