Closed Thread Icon

Topic awaiting preservation: JaaScript Starcube Pages that link to <a href="http://ozoneasylum.com/backlink?for=25096" title="Pages that link to Topic awaiting preservation: JaaScript Starcube" rel="nofollow" >Topic awaiting preservation: JaaScript Starcube\

 
Author Thread
BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 02-24-2005 01:47

I remember a starcube thread from a while back... and was playing around with some old JS last night, and came up with this:

http://www.soterm.com/dan/starcube.html

Not the best example of 3D maths in the world, I'm sure ... but then again, I'm only a humble web developer

I started off with using opacity for the stars, then realised it would probably be far more efficient to simply work out the colour for them instead... Also meaning you can change to shades of other colours really easily, too (for example, change the last two uses of 'newRGBCol' to '0' to go from shades of white to shades of red).

Tested working fine in IE 6, FF 1, NN 6, Safari 1.2, Opera 7, and IE 5.2 (Mac OS X)

Enjoy!

Dan

(Edited by BillyRayPreachersSon on 02-24-2005 01:52)

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-24-2005 19:49

Neat but I miss the projection.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 02-24-2005 20:08

yep, no perspective projection there.

do the famous division by z.

--
www.embege.com

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-24-2005 20:26

Don't forget to take care of the negative values of Z if you don't want to receive some dots in your head.

BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 02-24-2005 22:04

Perspective projection? I never was any good at the tecnhical details

(Edited by BillyRayPreachersSon on 02-24-2005 22:04)

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-24-2005 22:17

Google: Perspective projection formula

BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 02-25-2005 17:36

Here you go - I think it's correct (for only 2 lines added?!)

http://www.soterm.com/dan/starcube_perspective.html

Dan

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-25-2005 17:42

that's mucho better.

« BackwardsOnwards »

Show Forum Drop Down Menu