Code archives/3D Graphics - Effects/Spacesphere

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

Download source code

Spacesphere by Chroma2006
Play around with the sptex scale a bit to suit your tastes.
;Spacesphere

;Create the Texture
sptex = CreateTexture(1024,1024,1+8)
SetBuffer TextureBuffer(sptex)
For a = 1 To 200
	Plot Rand(0,1023),Rand(0,1023)
Next
SetBuffer BackBuffer()
TextureBlend sptex,5

;Create the Sphere
spbox = CreateSphere(5)
ScaleEntity spbox,10000,10000,10000
EntityTexture spbox,sptex
ScaleTexture sptex,.25,.5
EntityFX spbox,1
FlipMesh spbox
EntityOrder spbox,99999

Comments

markcw2006
Here is a working example.




Boiled Sweets2006
Stars get dimmer when you move - shame.


Andres2006
I see only one ball circling around me and a big white sphere around the camera.


Rook Zimbabwe2006
ANDRES you probably have nVidia graphics card yes?

Why does the LEFT arrow mess this (slightly more complicated) example up?


I don't get it... trying to do the double starfield effect like on Trek... The LEFT ARROW seems to spin madly... all else works!


Stevie G2006
Rook - you've left out the decimal points in the 35 & 30 ... there's an extra ", 0" there instead ;)


Rook Zimbabwe2006
yipes!!! Thanks Stevie!


Andres2006
Rook Zimbabwe: Nope, I have ATI Radeon 9600se

TextureBlend sptex,5 ruined the texture, i can't use third (add)blend mode, but it works with second (multiply)


Code Archives Forum