3D\ starfield

Blitz3D Forums/Blitz3D Beginners Area/3D\ starfield

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok got the stars appearing infront of the camera very effectively. I have 200 sprites now and the effect when turning is very realistic.

I understand there's likely a faster way, but after 24 hours, this is where it stands.

Teff


Function update_stars()

If MilliSecs() > timer2 + 100
timer2=MilliSecs() : theta=50

For i=1 To numstars
st=stars(i)
If EntityInView(st,camera)=0
EntityParent st,camera
PositionEntity st,EntityX(camera),EntityY(camera),EntityZ(camera),1
RotateEntity st,EntityX(st)+Rand(-theta,theta),EntityY(st)+Rand(-theta,theta),1
EntityParent st,0
MoveEntity st,0,0,Rand(500)+1500
EndIf
Next

EndIf

End Function