I don't think he would mind sence then only thing that is his is the shape. the math and algorith are allover the internet. what I give myself credit for is the multyplier. That is all my idea and is what makes the shape interesting.
I even inproved on the color scheme from original post. below is code I downloaded some where from a Qbasic forum years ago and converted to Blitzmax:
AppTitle = "cube"
Type Tnode
Field x#
Field y#
Field z#
End Type
Global node:tnode
Global X, Y, Z, sX#, sY#,sXs#, sYs#, D#
Global AngleAxisz#, AngleAxisx#, AngleAxisy#, mZ#
Global sinAngleAxisz#,cosAngleAxisz#, cosAngleAxisx#, sinAngleAxisx#, sinAngleAxisy#, cosAngleAxisy#
Global nodeList:TList
RestoreData cube
Local nodes
ReadData nodes
For I = 1 To nodes
node= New tnode
If Not nodeList nodelist = CreateList()
nodelist.addlast(node)
ReadData node.x,node.y,node.z
Next
InitProgram()
MainLoop()
End
Function Calc3D()
X = -1 * X;
Local Xa# = cosAngleAxisz * X - sinAngleAxisz * Z;
Local Za# = sinAngleAxisz * X + cosAngleAxisz * Z
Local Ya# = cosAngleAxisx * Y - sinAngleAxisx * Xa;
X = cosAngleAxisx * Xa + sinAngleAxisx * Y;
Z = cosAngleAxisy * Za - sinAngleAxisy * Ya
Y = sinAngleAxisy * Za + cosAngleAxisy * Ya;
Z = Z + mZ
sX = D * X / Z
sY = D * Y / Z
End Function
Function DrawObject()
Rotateobject
Local I = 1
For node = EachIn nodeList
X = node.x
Y = node.y
Z = node.z
Calc3D
If Not (I Mod 2) DrawLine sXs, sYs , sX, sY 'get start and end points before drawing.
sXs = sX; sYs = sY
I = I+1
Next
End Function
Function InitProgram()
Graphics 640,480
SetOrigin 320, 240
SetColor 255,0,0
D# = 500 'View point And rotation values
mZ# = -400 'shift from z axis away from viewpoint
AngleAxisz# = 0 'spin along y axis; angle of z
AngleAxisx# = 0 'spin along z axiz; angle of x
AngleAxisy# = 0 'spin along x axis; angle of y
End Function
Function MainLoop()
While Not KeyDown(KEY_ESCAPE)
Cls
'AngleAxisz = AngleAxisz + 1; angleAxisz = AngleAxisz Mod 360 'comment out to spin all 3 axis
AngleAxisx = AngleAxisx + 1; angleAxisx = AngleAxisx Mod 360
AngleAxisy = AngleAxisy + 3; angleAxisy = AngleAxisy Mod 360
DrawObject
Flip
Wend
End Function
Function Rotateobject()
sinAngleAxisz = Sin(AngleAxisz)
cosAngleAxisz = Cos(AngleAxisz)
sinAngleAxisx = Sin(AngleAxisx)
cosAngleAxisx = Cos(AngleAxisx)
sinAngleAxisy = Sin(AngleAxisy)
cosAngleAxisy = Cos(AngleAxisy)
End Function
' replace FACE in restoredata to CUBE to display a cube.
#CUBE 'LOOKING THINGY
DefData 50 'defines number of point to read
DefData -90,-90,-90, -90,-90,90, -90,-90,90, 90,-90,90
DefData 90,-90,90, 90,-90,-90, 90,-90,-90, -90,-90,-90
DefData -90,90,-90, -90,90,90, -90,90,90, 90,90,90
DefData 90,90,90, 90,90,-90, 90,90,-90, -90,90,-90
DefData -90,90,-90, -90,-90,-90, -90,-90,90, -90,90,90
DefData 90,90,90, 90,-90,90, 90,-90,-90, 90,90,-90
DefData -90,0,-90, -90,0,90, -90,0,90, 90,0,90
DefData 90,0,90, 90,0,-90, 90,0,-90, -90,0,-90
DefData -90,0,-90, 0,90,0, -90,0,90, 0,90,0
DefData 90,0,90, 0,90,0, 90,0,-90, 0,90,0
DefData -90,0,-90, 0,-25,0, -90,0,90, 0,-25,0
DefData 90,0,90, 0,-25,0, 90,0,-90, 0,-25,0
DefData 0,-25,0, 0,90,0