Code archives/3D Graphics - Effects/quick deathstar effect (tm)

This code has been declared by its author to be Public Domain code.

Download source code

quick deathstar effect (tm) by Rob2002
take a peek!
;instant space glowing windows & lots of bits effect
; rob cummings (rob@redflame.net)

Graphics3D 640,480,16,2

camera=CreateCamera()
CameraRange camera,1,2000
MoveEntity camera,0,0,-1000
deathstar=CreateSphere(16)
ScaleEntity deathstar,500,500,500
light=CreateLight(2)
MoveEntity light,1000,1000,-1000
AmbientLight 32,32,32

;create crap chunky metal texture
basetex=CreateTexture(256,256,8)
SetBuffer TextureBuffer(basetex)
For i=0 To 511
	c=Rnd(64)+128
	Color c/2,c/2,c/2
	x=Rnd(255):y=Rnd(255)
	w=Rnd(64):h=Rnd(64)
	Rect x,y,2+w,2+h,1
	Color c,c,c
	Rect x+2,y+2,w,h,1
Next 

;create bright windows texture
windows=CreateTexture(256,256)
SetBuffer TextureBuffer(windows)
For i=0 To 100
	Color 255,255,255
	Rect Rnd(255),Rnd(255),1+Rnd(4),1+Rnd(2),1
Next 


;map the deathstar with these textures
ScaleTexture basetex,0.1,0.2
EntityTexture deathstar,basetex,0,0

ScaleTexture windows,0.5,0.2
TextureBlend windows,3
EntityTexture deathstar,windows,0,1

SetBuffer BackBuffer()
While Not KeyHit(1)
	TurnEntity deathstar,0,-.05,0
	RenderWorld
	Flip
Wend
End

Comments

Clyde2004
I think this is really neat!
Welldone mate :)


puki2004
Yep, I came across it a couple of days ago - I put it in my 'Elite' style demo - I actually came across it while 'Googling' for other stuff. The old "Cummings" has produce a nice effect here. Not sure how long it has been here as the site doesn't log the date when the person submits their code.


Ryudin2009
Okay... that is awesome.


slenkar2009
yeah its cool


Code Archives Forum