Holy fucking shit I don't want to work on this. Sibly, you son of a ...
@@ -0,0 +1,249 @@
|
||||
;-----------------------------------------------------------------------
|
||||
; Big Bang 1.b
|
||||
; 07/31/01
|
||||
;
|
||||
; Written By Richard R Betson
|
||||
; www.redeyeware.50megs.com
|
||||
; vidiot@getgoin.net
|
||||
; Copyright 2001, Richard Betson
|
||||
;-----------------------------------------------------------------------
|
||||
AppTitle "Big Bang 1.b"
|
||||
Include "../start.bb"
|
||||
|
||||
AmbientLight 150,150,150
|
||||
|
||||
Dim sphere(2)
|
||||
|
||||
|
||||
alpha#=1
|
||||
inc#=0
|
||||
os#=1
|
||||
sx#=2
|
||||
sy#=2
|
||||
|
||||
|
||||
Global sky1
|
||||
Global sky2
|
||||
time=MilliSecs()+6000
|
||||
|
||||
;----------------------------------
|
||||
; Create Camera
|
||||
;----------------------------------
|
||||
c_pivot=CreatePivot() ;Camera Pivot
|
||||
camera=CreateCamera(c_pivot) ;Create Camera
|
||||
PositionEntity camera,0,-8,13.5 ;Position camera
|
||||
CameraZoom camera,1.4 ;Zoom in jus a bit
|
||||
CameraRange camera,.1,150 ;Limit camera range
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Textures
|
||||
;----------------------------------
|
||||
texture1=CreateTexture(64,64)
|
||||
SetBuffer TextureBuffer(texture1)
|
||||
Color 128,255,32
|
||||
For y=0 To 64 Step 8
|
||||
For x=0 To 64
|
||||
Rect x,y,1,1,1
|
||||
Rect y,x,1,1,1
|
||||
Rect y-x,x,1,1
|
||||
Rect (64-y)+x,x,1,1
|
||||
Next
|
||||
Next
|
||||
|
||||
SetBuffer BackBuffer()
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Pressure Waves
|
||||
;----------------------------------
|
||||
texture1=LoadTexture("gate4.bmp",9)
|
||||
s_pivot=CreatePivot()
|
||||
sphere1=CreateSphere(10,s_pivot)
|
||||
EntityTexture sphere1,texture1
|
||||
;EntityFX sphere1,1
|
||||
EntityBlend sphere1,3
|
||||
ScaleEntity sphere1,.1,.1,.1
|
||||
UpdateNormals sphere1
|
||||
TurnEntity sphere1,58,0,0
|
||||
PointEntity camera,sphere1
|
||||
For i=0 To 2
|
||||
sphere(i)=CopyEntity(sphere1)
|
||||
Next
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Sun
|
||||
;----------------------------------
|
||||
sun=LoadSprite("bigspark.bmp",8)
|
||||
ScaleSprite sun,.2,.2
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Ring
|
||||
;----------------------------------
|
||||
ring=LoadSprite("ring2.bmp",8)
|
||||
ScaleSprite ring,.2,.2
|
||||
SpriteViewMode ring,2
|
||||
PositionEntity ring,0,0,-1
|
||||
TurnEntity ring,0,120,0
|
||||
HideEntity ring
|
||||
|
||||
|
||||
make_sky()
|
||||
|
||||
FreeEntity sphere1
|
||||
|
||||
|
||||
|
||||
i=0
|
||||
SetBuffer BackBuffer()
|
||||
|
||||
;----------------------------------
|
||||
; Main Loop
|
||||
;----------------------------------
|
||||
While Not KeyHit(1)
|
||||
sx=sx-.005
|
||||
sy=sy-.005
|
||||
os=os-.0025
|
||||
|
||||
If os>0 And go=0 And stm2<MilliSecs()
|
||||
ScaleSprite sun,sx+Rnd#(os),sy+Rnd#(os)
|
||||
stm2=MilliSecs+1
|
||||
stm=MilliSecs()+200
|
||||
Else
|
||||
|
||||
If stm>MilliSecs()
|
||||
ShowEntity ring
|
||||
ScaleSprite sun,20,20
|
||||
Else
|
||||
go=1
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
If sky_tm<MilliSecs()
|
||||
TurnEntity sky1,0,.2,0
|
||||
TurnEntity sky2,0,.3,0
|
||||
sky_tm=MilliSecs()+40
|
||||
EndIf
|
||||
|
||||
If go=1
|
||||
If tm<MilliSecs()
|
||||
ScaleSprite sun,20-(inc*2),20-(inc*2)
|
||||
EntityAlpha sun,alpha
|
||||
If inc#>3 Then inc#=inc+.12 Else inc=inc+.14
|
||||
swap#=swap+.1
|
||||
alpha#=alpha-.011
|
||||
tm=MilliSecs()+18
|
||||
EndIf
|
||||
If inc<16
|
||||
i=0
|
||||
ScaleEntity sphere(i),inc+inc2#,inc+inc2#,inc+inc2#
|
||||
EntityAlpha sphere(i),alpha
|
||||
TurnEntity sphere(i),0,0,-.5
|
||||
UpdateNormals sphere(i)
|
||||
EndIf
|
||||
|
||||
|
||||
If inc>1.5 And inc<18
|
||||
i=1
|
||||
ScaleEntity sphere(i),inc-1.5+inc2#,inc-1.5+inc2#,inc-1.5+inc2#
|
||||
EntityAlpha sphere(i),alpha+.2
|
||||
TurnEntity sphere(i),0,0,.5
|
||||
UpdateNormals sphere(i)
|
||||
EndIf
|
||||
|
||||
|
||||
If inc>3
|
||||
i=2
|
||||
ScaleEntity sphere(i),inc-3+inc2#,inc-3+inc2#,inc-3+inc2#
|
||||
EntityAlpha sphere(i),alpha+.4
|
||||
TurnEntity sphere(i),0,0,-1
|
||||
UpdateNormals sphere(i)
|
||||
ScaleSprite ring,(inc*2)-3,(inc*2)-3
|
||||
EntityAlpha ring,alpha+.4
|
||||
EndIf
|
||||
|
||||
|
||||
If inc>26
|
||||
inc=0
|
||||
alpha=1
|
||||
ScaleSprite sun,3,3
|
||||
EntityAlpha sun,1
|
||||
HideEntity ring
|
||||
go=0
|
||||
os#=1
|
||||
sx#=2
|
||||
sy#=2
|
||||
stm=MilliSecs()+200
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
|
||||
UpdateWorld
|
||||
RenderWorld
|
||||
|
||||
If time>MilliSecs()
|
||||
Color 255,0,0
|
||||
Text 10,10,"Big Bang * Written By Richard Betson"
|
||||
Text 10,25,"www.redeyeware.50megs.com"
|
||||
Color 64,255,32
|
||||
Text 10,40,"Press Escape to Exit."
|
||||
EndIf
|
||||
|
||||
Flip
|
||||
|
||||
Wend
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
|
||||
Function make_sky()
|
||||
;---------------------------------
|
||||
;Create Texture for Sky (STARS)
|
||||
;---------------------------------
|
||||
heaven=CreateTexture(128,128,1)
|
||||
SetBuffer TextureBuffer(heaven)
|
||||
For i=0 To 150
|
||||
If Rnd(100)>80
|
||||
Color 32,32,255
|
||||
Else
|
||||
Color 255,255,255
|
||||
EndIf
|
||||
Plot Rnd(256),Rnd(256)
|
||||
Next
|
||||
|
||||
heaven2=CreateTexture(128,128,1)
|
||||
SetBuffer TextureBuffer(heaven2)
|
||||
For i=0 To 80
|
||||
If Rnd(100)>80
|
||||
Color 255,32,32
|
||||
Else
|
||||
Color 255,255,255
|
||||
EndIf
|
||||
Plot Rnd(256),Rnd(256)
|
||||
Next
|
||||
|
||||
|
||||
;---------------------------------
|
||||
;Create Spheres for Sky
|
||||
;Set Entity and Texture Flags
|
||||
;---------------------------------
|
||||
|
||||
sky1=CreateSphere()
|
||||
ScaleTexture heaven,.16,.16
|
||||
EntityTexture sky1,heaven,0,0;Apply Multiple Textures to Sphere
|
||||
FlipMesh sky1 ;Flip Mesh (Texture) to face the inside of Sphere
|
||||
ScaleEntity sky1,90,90,90 ;Scale the Sphere
|
||||
EntityFX sky1,1 ;Set to FullBright
|
||||
|
||||
|
||||
sky2=CreateSphere()
|
||||
ScaleTexture heaven2,.16,.20
|
||||
EntityTexture sky2,heaven2,0,0
|
||||
FlipMesh sky2
|
||||
ScaleEntity sky2,80,80,80
|
||||
EntityAlpha sky2,.4
|
||||
EntityFX sky2,1
|
||||
|
||||
End Function
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 192 KiB |
@@ -0,0 +1,163 @@
|
||||
;-----------------------------------------------------------------------
|
||||
; Binary Cage 1.1 (multi-texture)
|
||||
; 07/17/01
|
||||
; Written By Richard R Betson
|
||||
; Copyright, 2001 Richard R Betson
|
||||
; www.redeyeware.50megs.com
|
||||
; vidiot@getgoin.net
|
||||
;-----------------------------------------------------------------------
|
||||
AppTitle "Binary Cage"
|
||||
Include "../start.bb"
|
||||
;Graphics3D 640,480,16
|
||||
|
||||
;----------------------------------
|
||||
; Variables
|
||||
;----------------------------------
|
||||
Dim boxes(40)
|
||||
z=60
|
||||
y=-5
|
||||
x=-5
|
||||
Global speed#=.3 ;Camera Pull-Back speed
|
||||
Global C_Rotation#=.7 ;Camera Rotation speed
|
||||
|
||||
AmbientLight 200,200,200 ;Set lighting
|
||||
|
||||
;----------------------------------
|
||||
; Create Textures
|
||||
;----------------------------------
|
||||
texture1=CreateTexture(64,64)
|
||||
SetBuffer TextureBuffer(texture1)
|
||||
;Color 32,255,64
|
||||
Color 255,32,64
|
||||
Rect 0,0,64,64,1
|
||||
Color 0,0,0
|
||||
;Color 255,255,255
|
||||
Rect 1,1,62,62,1
|
||||
|
||||
font=LoadFont("Arial",18,False,False,False)
|
||||
SetFont font
|
||||
;texture2=CreateTexture(64,64,1)
|
||||
;SetBuffer TextureBuffer(texture2)
|
||||
;Color 255,255,255
|
||||
;Color 0,0,0
|
||||
;Rect 0,0,64,64
|
||||
Color 32,32,200
|
||||
Text 0,32,"3D"
|
||||
Text 0,48,"BB-3D"
|
||||
SetBuffer BackBuffer()
|
||||
|
||||
;----------------------------------
|
||||
; Create Camera
|
||||
;----------------------------------
|
||||
c_pivot=CreatePivot()
|
||||
camera=CreateCamera(c_pivot)
|
||||
CameraZoom camera,.7
|
||||
CameraRange camera,.1,30
|
||||
CameraFogMode camera,1
|
||||
CameraFogColor camera,16,0,128
|
||||
CameraFogRange camera,10,60
|
||||
|
||||
;----------------------------------
|
||||
; Create Boxes for Cage
|
||||
;----------------------------------
|
||||
box=CreateCube()
|
||||
EntityTexture box,texture1,0,0
|
||||
;EntityTexture box,texture2,0,1
|
||||
UpdateNormals box
|
||||
ScaleEntity box,5,5,5
|
||||
EntityBlend box,3
|
||||
EntityFX box,1
|
||||
FlipMesh box
|
||||
|
||||
;hw=True
|
||||
;HWMultiTex hw
|
||||
|
||||
;TextureBlend texture1,1
|
||||
;TextureBlend texture2,3
|
||||
|
||||
;EntityBlend box,1
|
||||
|
||||
cage_pivot1=CreatePivot()
|
||||
cage_pivot2=CreatePivot()
|
||||
|
||||
For b=1 To 20
|
||||
boxes(b)=CopyEntity(box)
|
||||
EntityParent boxes(b),cage_pivot1
|
||||
Next
|
||||
For b=21 To 40
|
||||
boxes(b)=CopyEntity(box)
|
||||
EntityParent boxes(b),cage_pivot2
|
||||
Next
|
||||
For b=1 To 20
|
||||
PositionEntity boxes(b),y,x,z
|
||||
y=y+5
|
||||
ii=ii+1
|
||||
If y=>5
|
||||
y=-5
|
||||
x=x+5
|
||||
EndIf
|
||||
If ii=10
|
||||
x=-5
|
||||
z=z-5
|
||||
ii=0
|
||||
EndIf
|
||||
Next
|
||||
For b=21 To 40
|
||||
PositionEntity boxes(b),y,x,z
|
||||
y=y+5
|
||||
ii=ii+1
|
||||
If y=>5
|
||||
y=-5
|
||||
x=x+5
|
||||
;z=z-5
|
||||
|
||||
EndIf
|
||||
If ii=10
|
||||
x=-5
|
||||
z=z-5
|
||||
ii=0
|
||||
EndIf
|
||||
Next
|
||||
|
||||
FreeEntity box
|
||||
|
||||
;----------------------------------
|
||||
; Line-up Camera and Cage
|
||||
;----------------------------------
|
||||
PositionEntity cage_pivot2,0,-10,-30
|
||||
PositionEntity cage_pivot1,0,-40,-40
|
||||
PositionEntity c_pivot,-2,-20,17
|
||||
PositionEntity camera,0,0,0
|
||||
TurnEntity c_pivot,-90,0,0
|
||||
|
||||
|
||||
light=CreateLight()
|
||||
;----------------------------------
|
||||
; Main Loop
|
||||
;----------------------------------
|
||||
While Not KeyHit(1)
|
||||
|
||||
swap#=swap+speed ;Increment for cage swap
|
||||
|
||||
xx#=xx-speed ;increment to pull back camera
|
||||
|
||||
PositionEntity c_pivot,-2,-20+xx,17 ;Pull back parent entity of camera
|
||||
TurnEntity camera,0,0,c_rotation ;Turn camera
|
||||
PositionEntity light,-2,-10-xx,17
|
||||
If swap=>25 ;Bring the furthest cage to the front
|
||||
If cage=0
|
||||
PositionEntity cage_pivot2,0,-40+xx,-30 ;Position cage just behind camera
|
||||
cage=1
|
||||
swap=0
|
||||
Else
|
||||
PositionEntity cage_pivot1,0,-40+xx,-40
|
||||
swap=0
|
||||
cage=0
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
UpdateWorld
|
||||
RenderWorld
|
||||
Flip
|
||||
|
||||
Wend
|
||||
|
After Width: | Height: | Size: 48 KiB |
@@ -0,0 +1,204 @@
|
||||
;-----------------------------------------------------------------------
|
||||
; Power Fountain 1.b
|
||||
; 07/28/01
|
||||
;
|
||||
; Written By Richard R Betson
|
||||
; Copyright, 2001 Richard R Betson
|
||||
; www.redeyeware.50megs.com
|
||||
; vidiot@getgoin.net
|
||||
; Spite movement based on code by Simon Harris (config2000@hotmail.com)
|
||||
;-----------------------------------------------------------------------
|
||||
AppTitle "Power Fountain"
|
||||
Include "../start.bb"
|
||||
;Graphics3D 640,480,16
|
||||
SetBuffer BackBuffer()
|
||||
AmbientLight 10,10,10
|
||||
|
||||
|
||||
Dim sparks(80)
|
||||
Global time=8000+MilliSecs()
|
||||
Const total_sprites=80 ;Total number of sprites
|
||||
Global fi#=.2
|
||||
|
||||
|
||||
Type sprite_type
|
||||
Field x#,y# ;Position
|
||||
Field vx#,vy# ; Velocity
|
||||
Field delay_time ; Delay
|
||||
End Type
|
||||
|
||||
Global sprite.sprite_type
|
||||
|
||||
|
||||
For d=1 To total_sprites
|
||||
sprite.sprite_type=New sprite_type
|
||||
sprite_pos()
|
||||
sprite\delay_time=Rnd(50)
|
||||
Next
|
||||
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Camera
|
||||
;----------------------------------
|
||||
c_pivot=CreatePivot() ;Camera Pivot
|
||||
camera=CreateCamera(c_pivot) ;Create Camera
|
||||
PositionEntity camera,0,-10,7.5 ;Position camera
|
||||
;CameraZoom camera,1.1 ;Zoom in jus a bit
|
||||
CameraRange camera,.1,100 ;Limit camera range
|
||||
CameraFogMode camera,1 ;Fog on
|
||||
CameraFogColor camera,16,0,128 ;Color fog
|
||||
CameraFogRange camera,60,90 ;Visible fog range
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Sparks
|
||||
;----------------------------------
|
||||
;spark_pivot=CreatePivot()
|
||||
spark=LoadSprite("spark.bmp",1) ;Load bitmap for sprite "1" colored
|
||||
ScaleSprite spark,.7,.7 ;Scale the sprite a little smaller
|
||||
If spark=0 Then End ;If the sprite did not load function error
|
||||
|
||||
|
||||
For i=1 To 80
|
||||
sparks(i)=CopyEntity(spark) ;Make a copy of the sprite and color it
|
||||
EntityColor sparks(i),Rnd(255),Rnd(255),Rnd(255)
|
||||
Next
|
||||
|
||||
FreeEntity spark
|
||||
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Fountain
|
||||
;----------------------------------
|
||||
brick=LoadTexture("brick1.bmp",1) ;Load texture "1" colored
|
||||
ScaleTexture brick,.5,.5 ;Scale texture
|
||||
pad1_pivot=CreatePivot() ;create a pivot for fountain (not really needed)
|
||||
pad1=CreateCube(pad1_pivot) ;Create a cube with it's parent a pivot
|
||||
EntityTexture pad1,brick ;Apply texture
|
||||
ScaleEntity pad1,.55,1.5,.55 ;Scale the cube
|
||||
PositionEntity pad1,0,0,1.55 ;Position the cube
|
||||
UpdateNormals pad1 ;Update texture
|
||||
TurnEntity pad1,90,0,0 ;Turn the cube so it will match mirror plane
|
||||
|
||||
pad2=CreateCube(pad1_pivot)
|
||||
EntityTexture pad2,brick
|
||||
ScaleEntity pad2,1,.2,1
|
||||
PositionEntity pad2,0,0,0;1.80
|
||||
TurnEntity pad2,90,0,0
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Plane
|
||||
;----------------------------------
|
||||
stone=LoadTexture("stone.bmp",2) ;Load texture "2" Alpha
|
||||
ScaleTexture stone,2,2 ;Scale texture
|
||||
plane=CreatePlane(10,pad1) ;Create plane with segments of 10
|
||||
EntityTexture plane,stone ;Texture plane
|
||||
PositionEntity plane,0,-1.1,0
|
||||
|
||||
;----------------------------------
|
||||
; Create Mirror
|
||||
;----------------------------------
|
||||
|
||||
mirror=CreateMirror(pad1) ;Create mirror
|
||||
PositionEntity mirror,0,-1.2,0
|
||||
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Light
|
||||
;----------------------------------
|
||||
|
||||
light1=CreateLight(3) ;Create Light
|
||||
LightConeAngles light1,1,90 ;Adjust Light Cone Angle
|
||||
PositionEntity light1,0,-10,50 ;Position light
|
||||
LightColor light1,255,255,255 ;Full brightt white light
|
||||
LightRange light1,100 ;Set light range
|
||||
EntityParent light1,c_pivot ;Make the lights parent camera's pivot
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PointEntity camera,pad1 ;Point to fountain
|
||||
PointEntity light1,pad1
|
||||
|
||||
|
||||
HideEntity plane ;Hide plane
|
||||
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Main Loop
|
||||
;----------------------------------
|
||||
While Not KeyHit(1)
|
||||
|
||||
For sprite.sprite_type = Each sprite_type ;Loop through each sprite type
|
||||
n=n+1 ;counter for sprites
|
||||
If sprite\delay_time=0 ;Check condition of delay until 0
|
||||
sprite\x#=sprite\x#-sprite\vx# ;Subtract velocity from position
|
||||
sprite\vy#=sprite\vy#+.005 ;Velocity y +.005
|
||||
sprite\y#=sprite\y#-sprite\vy# ;Subtract velocity from position
|
||||
If sprite\y<-.5 Then sprite_pos() ;Collision detection
|
||||
zz#=((Sin((n*2)*Pi)*sprite\x)) ;Add 3rd dimension to sparks based on x
|
||||
PositionEntity sparks(n),sprite\x,zz,sprite\y ;Position sprite
|
||||
Else
|
||||
sprite\delay_time=sprite\delay_time-1 ;Subtract 1 from delay time
|
||||
EndIf
|
||||
Next
|
||||
zz=0 ;reset
|
||||
n=0
|
||||
|
||||
|
||||
TurnEntity c_pivot,0,0,.5 ;Orbit camera and light
|
||||
|
||||
|
||||
If KeyHit(2) ;key 1 for plane toggle
|
||||
If on_off=0
|
||||
ShowEntity plane ;show plane
|
||||
on_off=1
|
||||
Else
|
||||
HideEntity plane ;hide plane
|
||||
on_off=0
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
If KeyHit(3) ;key 2 for spark color toggle
|
||||
If on_off1=0
|
||||
For i=1 To 80
|
||||
EntityColor sparks(i),255,128,32 ;Set sparks color
|
||||
Next
|
||||
on_off1=1
|
||||
Else
|
||||
For i=1 To 80
|
||||
EntityColor sparks(i),Rnd(255),Rnd(255),Rnd(255)
|
||||
Next
|
||||
on_off1=0
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
|
||||
|
||||
UpdateWorld
|
||||
RenderWorld
|
||||
If time>MilliSecs()
|
||||
Color 255,0,0
|
||||
Text 10,10,"Power Fountain * Written By Richard Betson"
|
||||
Text 10,25,"www.redeyeware.50megs.com"
|
||||
Color 64,255,32
|
||||
Text 10,40,"Press 1 to toggle Plane reflection on/off."
|
||||
Text 10,55,"Press 2 to toggle Spark Color."
|
||||
EndIf
|
||||
Flip
|
||||
|
||||
Wend
|
||||
|
||||
|
||||
Function sprite_pos()
|
||||
sprite\x# =0 ;Set x width
|
||||
sprite\y# =3.55 ;Ser y height
|
||||
sprite\vx#=Rnd(.09)-Rnd(.09) ;Set velocity amount
|
||||
sprite\vy#=-.2+Rnd(.15) ;Set velocity amount
|
||||
End Function
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 48 KiB |
@@ -0,0 +1,11 @@
|
||||
Emerald Gate 1.0
|
||||
Written By Richard Betson
|
||||
www.redeyeware.50megs.com
|
||||
vidiot@getgoin.net
|
||||
|
||||
Gate/Portal demo with animated texture and mesh wave deformation. The following files are Copyright 2001 Richard Betson:
|
||||
my_stargate.3ds
|
||||
water_anim.bmp
|
||||
|
||||
You can use theese file in any "not for profit" demo or other program. All other rights reserved.
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
;-----------------------------------------------------------------------
|
||||
; Emerald Gate 1.0
|
||||
; 07/26/01
|
||||
;
|
||||
; Written By Richard R Betson
|
||||
; Copyright, 2001 Richard R Betson
|
||||
; www.redeyeware.50megs.com
|
||||
; vidiot@getgoin.net
|
||||
; Texture wave motion code from Flag Demo, Blitz Basic 3D (Author Unknown)
|
||||
;-----------------------------------------------------------------------
|
||||
AppTitle "Emerald Gate"
|
||||
Include "../start.bb"
|
||||
;Graphics3D 800,600,16
|
||||
SetBuffer BackBuffer()
|
||||
|
||||
|
||||
AmbientLight 100,100,100
|
||||
|
||||
|
||||
Const segs=40,width#=4,depth#=.09
|
||||
time=MilliSecs()+8000
|
||||
|
||||
;----------------------------------
|
||||
; Load Media
|
||||
;----------------------------------
|
||||
gate=LoadMesh("my_stargate3.3ds")
|
||||
g_tex=LoadTexture("gate1.bmp",65)
|
||||
tex=LoadAnimTexture( "water_anim.bmp",4,128,128,0,8 )
|
||||
floor_t=LoadTexture("stone.bmp",2)
|
||||
|
||||
;----------------------------------
|
||||
; Create Camera
|
||||
;----------------------------------
|
||||
c_pivot=CreatePivot() ;Camera Pivot
|
||||
camera=CreateCamera(c_pivot) ;Create Camera
|
||||
PositionEntity camera,0,-8,1.5 ;Position camera
|
||||
|
||||
CameraZoom camera,1.4 ;Zoom in jus a bit
|
||||
CameraRange camera,.1,100 ;Limit camera range
|
||||
CameraFogMode camera,1 ;Fog on
|
||||
CameraFogColor camera,16,0,128 ;Color fog
|
||||
CameraFogRange camera,0,60 ;Visible fog range
|
||||
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Gate
|
||||
;----------------------------------
|
||||
FitMesh gate,-1,-1,-1,2,2,2,True
|
||||
ScaleMesh gate,3,3,3
|
||||
TurnEntity gate,90,0,0
|
||||
PositionEntity gate,0,0,0
|
||||
EntityTexture gate,g_tex
|
||||
UpdateNormals gate
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Water Mesh
|
||||
;----------------------------------
|
||||
mesh=CreateMesh() ;Create water mesh
|
||||
surf=CreateSurface( mesh ) ;Create a suface for mesh
|
||||
|
||||
For k=0 To segs ;Loop through segments of suface
|
||||
x#=Float(k)*width/segs-width/2 ;Get x position as F. Point
|
||||
u#=Float(k)/segs ;Get u pos. as F. Point
|
||||
AddVertex surf,x,1,0,u,0 ;Add a vertex/index (texture) to surface
|
||||
AddVertex surf,x,-1,0,u,1
|
||||
Next
|
||||
|
||||
For k=0 To segs-1 ;Loop through segments of surface
|
||||
AddTriangle surf,k*2,k*2+2,k*2+3 ;Add triangles to suface texture front and back
|
||||
AddTriangle surf,k*2,k*2+3,k*2+1
|
||||
AddTriangle surf,k*2,k*2+3,k*2+2
|
||||
AddTriangle surf,k*2,k*2+1,k*2+3
|
||||
Next
|
||||
|
||||
EntityTexture mesh,tex ;Texture water mesh
|
||||
TurnEntity mesh,90,0,0 ;Turn
|
||||
ScaleMesh mesh,1.24,2.50,0 ;Scale
|
||||
PositionMesh mesh,0,.25,0 ;Position
|
||||
EntityAlpha mesh,.6 ;Adjust mesh alpha (see through)
|
||||
EntityFX mesh,.7
|
||||
UpdateNormals mesh ;Update mesh normals
|
||||
|
||||
;----------------------------------
|
||||
; Create Mirror and Plane (Floor)
|
||||
;----------------------------------
|
||||
plane=CreatePlane(10,gate) ;Create Plane
|
||||
PositionEntity plane,0,-3.0,0 ;Position Plane
|
||||
EntityTexture plane,Floor_t ;Apply texture to plane
|
||||
|
||||
mirror=CreateMirror(gate) ;Create mirror
|
||||
PositionEntity mirror,0,-3.05,0
|
||||
|
||||
|
||||
;----------------------------------
|
||||
; Create Light
|
||||
;----------------------------------
|
||||
light1=CreateLight(3) ;Create Light
|
||||
LightConeAngles light1,1,90 ;Adjust Light Cone Angle
|
||||
PositionEntity light1,0,-10,20 ;Position light
|
||||
LightColor light1,255,255,255 ;Full brightt white light
|
||||
LightRange light1,100 ;Set light range
|
||||
EntityParent light1,c_pivot ;Make the lights parent camera's pivot
|
||||
|
||||
light2=CreateLight(2)
|
||||
LightColor light2,255,255,255
|
||||
PositionEntity light2,-.6,0,-2
|
||||
PointEntity light2,mesh
|
||||
|
||||
light3=CreateLight(2)
|
||||
PositionEntity light2,-3,0,-2
|
||||
PointEntity light3,mesh
|
||||
|
||||
|
||||
|
||||
;Point light and Camera at water mesh
|
||||
PointEntity camera,mesh ;Point camera to water mesh
|
||||
PointEntity light1,mesh ;Point light to water mesh
|
||||
|
||||
;----------------------------------
|
||||
; Main Loop
|
||||
;----------------------------------
|
||||
While Not KeyHit(1)
|
||||
ph#=MilliSecs()/1.3 ;Frequency of waves (time)
|
||||
cnt=CountVertices(surf)-1 ;Count all of the Vertices in water mesh
|
||||
|
||||
For k=0 To cnt ;Loop through mesh and update vertices
|
||||
x#=VertexX(surf,k)
|
||||
y#=VertexY(surf,k)
|
||||
z#=Sin(ph+x*200)*depth ;Create wave
|
||||
VertexCoords surf,k,x,y,z ;Update
|
||||
Next
|
||||
|
||||
|
||||
If tnt<MilliSecs() ;Timer
|
||||
EntityTexture mesh,tex,tn ;Texture water mesh with next frame of animated texture
|
||||
tn=tn+1 ;Counter
|
||||
If tn=8 Then tn=0 ;Check if end of frame is reached
|
||||
tnt=MilliSecs()+32 ;Reset timer
|
||||
EndIf
|
||||
|
||||
UpdateNormals mesh ;Update water mesh normals
|
||||
|
||||
|
||||
TurnEntity c_pivot,0,0,.5 ;Orbit camera and light
|
||||
|
||||
UpdateWorld
|
||||
RenderWorld
|
||||
|
||||
If time>MilliSecs()
|
||||
Color 255,0,0
|
||||
Text 10,10,"Emerald Gate * Written By Richard Betson"
|
||||
Text 10,25,"www.redeyeware.50megs.com"
|
||||
Color 64,255,32
|
||||
Text 10,40,"Press Escape to Exit."
|
||||
EndIf
|
||||
|
||||
Flip
|
||||
|
||||
Wend
|
||||
|
||||
|
||||
|
||||
Function error()
|
||||
SetBuffer FrontBuffer()
|
||||
Color 255,255,255
|
||||
Text 20,20,"ERROR LOADING MEDIA FILES!!! PLEASE INSTALL AGAIN!!"
|
||||
Delay 4000
|
||||
End
|
||||
End Function
|
||||
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 384 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,611 @@
|
||||
;===================================================================
|
||||
; Orbit The Nebula Demo 1.0
|
||||
; Written by Richard Betson
|
||||
; 07/16/01
|
||||
; www.redeyeware.50megs.com
|
||||
; Copyright 2001, Richard R Betson (if possible under NDA)
|
||||
;===================================================================
|
||||
|
||||
AppTitle "Orbit The Nebula Demo 1.0"
|
||||
Include "../start.bb"
|
||||
|
||||
;Graphics3D 640,480,16
|
||||
;---------------------------------
|
||||
;Variables
|
||||
;---------------------------------
|
||||
Dim rock_light(115)
|
||||
Dim rock(115)
|
||||
Dim spark(40)
|
||||
|
||||
;make_sky
|
||||
Global sky1
|
||||
Global sky2
|
||||
|
||||
;Make_sun
|
||||
Global spark_pivot1
|
||||
Global spark_pivot2
|
||||
Global spark_pivot3
|
||||
Global spark_pivot4
|
||||
|
||||
Global sun_light1
|
||||
Global sun_light2
|
||||
Global sun_light3
|
||||
|
||||
Global sun
|
||||
|
||||
Global spark_orbit_sprite1
|
||||
Global spark_orbit_sprite2
|
||||
|
||||
;make_planet
|
||||
Global ring
|
||||
Global ring2
|
||||
Global pv
|
||||
Global planet_pivot
|
||||
Global planet
|
||||
Global planet_light
|
||||
|
||||
;make_moon
|
||||
Global moon
|
||||
Global moon_pivot
|
||||
|
||||
;make_rock
|
||||
Global l1
|
||||
Global rock_pivot
|
||||
|
||||
;lens_flare
|
||||
Global flare1
|
||||
Global flare2
|
||||
Global flare3
|
||||
Global flare4
|
||||
|
||||
|
||||
sp1x_rate#=2.8
|
||||
sp1y_rate#=-2.8
|
||||
sp2x_rate#=-2.6
|
||||
sp2y_rate#=2.6
|
||||
sp3x_rate#=2.6
|
||||
sp3y_rate#=2.6
|
||||
sp4x_rate#=-.6
|
||||
sp4y_rate#=-2.6
|
||||
|
||||
|
||||
Const speed=4 ;Speed of Mouse Movement
|
||||
Global yaw1#=.1 ;Speed of Sphere Rotation
|
||||
Global yaw2#=.15
|
||||
Const spitch#=.3
|
||||
Const syaw#=.45
|
||||
|
||||
sw=GraphicsWidth()/2 ;Mouse Center Point
|
||||
sh=GraphicsHeight()/2
|
||||
|
||||
time=MilliSecs()+8000
|
||||
|
||||
|
||||
orbit_t#=.1
|
||||
Global oldpx1#
|
||||
time1=MilliSecs()
|
||||
|
||||
|
||||
|
||||
|
||||
signal=Load3DSound("signal.wav")
|
||||
If signal=0 Then error()
|
||||
LoopSound signal
|
||||
|
||||
|
||||
;---------------------------------
|
||||
;Set Lighting
|
||||
;---------------------------------
|
||||
AmbientLight 70,70,70
|
||||
|
||||
|
||||
;---------------------------------
|
||||
;Create Piviot and Camera Entities
|
||||
;_________________________________
|
||||
pivot=CreatePivot()
|
||||
pv1=CreatePivot()
|
||||
camera=CreateCamera(pivot)
|
||||
|
||||
|
||||
;listen=CreateListener(sun,.1,.2,.2)
|
||||
;EmitSound signal,sun
|
||||
|
||||
|
||||
TurnEntity camera,80,0,0
|
||||
|
||||
|
||||
|
||||
make_sky()
|
||||
make_sun()
|
||||
make_planet()
|
||||
make_moon()
|
||||
make_rocks()
|
||||
lens_flare()
|
||||
|
||||
|
||||
;listen=CreateListener(camera,.1,.5,.5)
|
||||
;EmitSound signal,sun
|
||||
|
||||
;--------------------------------
|
||||
;Main Loop
|
||||
;--------------------------------
|
||||
While Not KeyHit(1)
|
||||
;If time1<MilliSecs()
|
||||
|
||||
|
||||
fps=fps+1
|
||||
If fps_t<MilliSecs()
|
||||
;fps2=fps
|
||||
fp$=" "+Str$(fps)
|
||||
fps_t=1000+MilliSecs()
|
||||
fps=0
|
||||
EndIf
|
||||
|
||||
|
||||
fps2=fps2+1
|
||||
If fps_t2<MilliSecs()
|
||||
fps3#=fps2
|
||||
;fp$=" "+Str$(fps)
|
||||
fps_t2=30+MilliSecs()
|
||||
fps2=0
|
||||
EndIf
|
||||
|
||||
|
||||
;If fps3>2
|
||||
|
||||
;sp1x_rate#=2.8-(fps3-4.50)
|
||||
;sp1y_rate#=-2.8-(fps3-4.50)
|
||||
;sp2x_rate#=-2.6-(fps3-4.50)
|
||||
;sp2y_rate#=2.6-(fps3-4.50)
|
||||
;sp3x_rate#=0;(fps3)
|
||||
;sp3y_rate#=0;(fps3)
|
||||
;sp4x_rate#=0;-(diff/100)
|
||||
;sp4y_rate#=0;-(diff/8)
|
||||
;orbit_t=.075-(fps3/80)
|
||||
;yaw1=.1-(fps3-1.5)
|
||||
;yaw2=.2-(fps3-1)
|
||||
;EndIf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TurnEntity sky1,0,yaw1,0,0 ;Turn (Yaw) Sphere 1
|
||||
TurnEntity sky2,0,yaw2,0,0 ;Turn (Yaw) Sphere 2
|
||||
|
||||
|
||||
TurnEntity planet_pivot,0,.9,0
|
||||
TurnEntity pv,0,.9,0
|
||||
TurnEntity moon_pivot,.8,.8,0
|
||||
|
||||
|
||||
|
||||
TurnEntity spark_pivot1,sp1x_rate,sp1y_rate,0
|
||||
TurnEntity spark_pivot2,sp2x_rate,sp2y_rate,0
|
||||
TurnEntity spark_pivot3,sp3x_rate,sp3y_rate,0
|
||||
TurnEntity spark_pivot4,sp4x_rate,sp4y_rate,0
|
||||
|
||||
|
||||
|
||||
si#=si#+.4+orbit_t
|
||||
If si>=114.25 Then si=0
|
||||
sx#=(5+(Sin(si*Pi)*20))
|
||||
sy#=(190+(Cos(si*Pi)*70))
|
||||
|
||||
PositionEntity spark_orbit_sprite1,sx-(sx*2),sy,sx
|
||||
PositionEntity spark_orbit_sprite2,sx,sy,sx
|
||||
|
||||
|
||||
fi#=fi+orbit_t
|
||||
If fi>=114.50 Then fi=0
|
||||
|
||||
px#=(2+(Sin(fi*Pi)*40))
|
||||
py#=(30 + (Cos(fi*Pi)*265))
|
||||
|
||||
PositionEntity camera,px,py,0
|
||||
|
||||
PositionEntity sky1,px,py,0
|
||||
PositionEntity sky2,px,py,0
|
||||
|
||||
If (fi>100 And fi<110) Or (fi>8 And fi<14)
|
||||
flare_counter#=flare_counter#+.8
|
||||
If fi>100 And fi<110 Then f_offset=15
|
||||
ShowEntity flare1
|
||||
ShowEntity flare2
|
||||
ShowEntity flare3
|
||||
ShowEntity flare4
|
||||
PositionEntity flare1,EntityX#(sun)+10-f_offset,EntityY#(sun)+10-(flare_counter)-f_offset,EntityZ#(sun)+5+flare_counter
|
||||
PositionEntity flare2,EntityX#(sun)+10-f_offset,EntityY#(sun)+20-(flare_counter)-f_offset,EntityZ#(sun)+10+flare_counter
|
||||
PositionEntity flare3,EntityX#(sun)+10-f_offset,EntityY#(sun)+30-(flare_counter)-f_offset,EntityZ#(sun)+15+flare_counter
|
||||
PositionEntity flare4,EntityX#(sun)+10-f_offset,EntityY#(sun)+40-(flare_counter)-f_offset,EntityZ#(sun)+20+flare_counter
|
||||
|
||||
Else
|
||||
f_offset=0
|
||||
flare_counter=0
|
||||
HideEntity flare1
|
||||
HideEntity flare2
|
||||
HideEntity flare3
|
||||
HideEntity flare4
|
||||
EndIf
|
||||
|
||||
|
||||
PointEntity camera,planet,90
|
||||
|
||||
|
||||
time1=MilliSecs()+delay_time
|
||||
odlpy#=py
|
||||
|
||||
;EndIf
|
||||
|
||||
|
||||
If KeyHit(2)
|
||||
orbit_t=orbit_t+.025
|
||||
EndIf
|
||||
|
||||
If KeyHit(3)
|
||||
orbit_t=orbit_t-.025
|
||||
If orbit_t<.025 Then orbit_t=.025
|
||||
EndIf
|
||||
|
||||
|
||||
UpdateNormals planet
|
||||
|
||||
UpdateWorld ;Update's
|
||||
RenderWorld ;.90
|
||||
|
||||
|
||||
|
||||
If time>MilliSecs()
|
||||
Color 255,255,255
|
||||
Text 10,10,"Orbit The Nebula"
|
||||
Text 10,25,"Orbit The Nebula Demo 1.0 by Richard Betson"
|
||||
Color 255,0,0
|
||||
Text 10,40,"www.redeyeware.50megs.com"
|
||||
Color 128,255,0
|
||||
Text 10,70,"Hit ESCAPE KEY to EXIT."
|
||||
Text 10,80,"Hit 1 to speed up, 2 to slow down demo."
|
||||
Else
|
||||
Text 10,10,"FPS: "+fp$
|
||||
EndIf
|
||||
;Text 10,10,px
|
||||
;Text 10,25,py
|
||||
;Text 10,40,fi
|
||||
|
||||
;Text 10,60,oldpx1-px1
|
||||
;Text 10,80,sp1x_rate
|
||||
;Text 10,95,orbit_t
|
||||
|
||||
Flip ;Flip to FrontBuffer()
|
||||
|
||||
|
||||
|
||||
If KeyHit(68)=1
|
||||
kh=1
|
||||
xxp=CreateImage(sw*2,sh*2)
|
||||
GrabImage xxp,0,0
|
||||
SaveImage(xxp,"screen.bmp")
|
||||
FreeImage xxp
|
||||
EndIf
|
||||
If GetKey()<>0 And kh=0
|
||||
exit_tdp=1
|
||||
EndIf
|
||||
|
||||
|
||||
oldpx1=px1
|
||||
Wend
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function make_sky()
|
||||
;---------------------------------
|
||||
;Create Texture for Sky (STARS)
|
||||
;---------------------------------
|
||||
heaven=CreateTexture(128,128,1)
|
||||
SetBuffer TextureBuffer(heaven)
|
||||
For i=0 To 150
|
||||
Color 155+Rnd(100),255,255
|
||||
Plot Rnd(256),Rnd(256)
|
||||
Next
|
||||
|
||||
heaven2=CreateTexture(128,128,1)
|
||||
SetBuffer TextureBuffer(heaven2)
|
||||
For i=0 To 80
|
||||
Color 155+Rnd(100),255,255
|
||||
Plot Rnd(256),Rnd(256)
|
||||
Next
|
||||
|
||||
|
||||
;---------------------------------
|
||||
;Load Nebula Textures
|
||||
;---------------------------------
|
||||
nebula=LoadTexture("nebula1.bmp")
|
||||
belt=LoadTexture("belt.bmp")
|
||||
If nebula=0 Then error()
|
||||
If belt=0 Then error()
|
||||
SetBuffer BackBuffer()
|
||||
|
||||
;---------------------------------
|
||||
;Create Spheres for Sky
|
||||
;Set Entity and Texture Flags
|
||||
;---------------------------------
|
||||
|
||||
sky1=CreateSphere()
|
||||
ScaleTexture heaven,.16,.16
|
||||
EntityTexture sky1,heaven,0,0 ;Apply Multiple Textures to Sphere
|
||||
EntityTexture sky1,nebula,0,1
|
||||
EntityTexture sky1,belt,0,2
|
||||
|
||||
TextureBlend heaven,1 ;Set Texture Flags
|
||||
TextureBlend nebula,3
|
||||
TextureBlend belt,3
|
||||
|
||||
FlipMesh sky1 ;Flip Mesh (Texture) to face the inside of Sphere
|
||||
ScaleEntity sky1,1000,1000,1000 ;Scale the Sphere
|
||||
EntityFX sky1,1 ;Set to FullBright
|
||||
|
||||
|
||||
sky2=CreateSphere()
|
||||
ScaleTexture heaven2,.16,.20
|
||||
EntityTexture sky2,heaven2,0,0
|
||||
TextureBlend heaven2,1
|
||||
FlipMesh sky2
|
||||
ScaleEntity sky2,900,900,900
|
||||
EntityAlpha sky2,.4
|
||||
EntityFX sky2,1
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function make_sun()
|
||||
|
||||
spark_pivot1=CreatePivot()
|
||||
spark_pivot2=CreatePivot()
|
||||
spark_pivot3=CreatePivot()
|
||||
spark_pivot4=CreatePivot()
|
||||
|
||||
PositionEntity spark_pivot1,0,190,0
|
||||
PositionEntity spark_pivot2,0,190,0
|
||||
PositionEntity spark_pivot3,0,190,0
|
||||
PositionEntity spark_pivot4,0,190,0
|
||||
|
||||
|
||||
|
||||
sun=CreateSphere()
|
||||
sun_brush=CreateBrush(255,32,0)
|
||||
PaintEntity sun,sun_brush
|
||||
PositionEntity sun,0,190,5
|
||||
ScaleEntity sun,4,4,4
|
||||
|
||||
|
||||
sun_light1=CreateLight(2)
|
||||
sun_light2=CreateLight(2)
|
||||
sun_light3=CreateLight(2)
|
||||
|
||||
LightColor sun_light1,255,255,255
|
||||
LightColor sun_light2,255,255,255
|
||||
LightColor sun_light3,255,255,255
|
||||
|
||||
LightRange sun_light1,150
|
||||
LightRange sun_light2,150
|
||||
LightRange sun_light3,150
|
||||
|
||||
|
||||
PositionEntity sun_light1,120,120,-10
|
||||
PositionEntity sun_light2,0,220,0
|
||||
PositionEntity sun_light3,-60,120,10
|
||||
|
||||
PointEntity sun_light1,sun
|
||||
PointEntity sun_light2,sun
|
||||
PointEntity sun_light3,sun
|
||||
|
||||
|
||||
|
||||
spark_sprite=LoadSprite("spark.bmp",1)
|
||||
sun_sprite=LoadSprite("spark.bmp",1)
|
||||
spark_orbit_sprite1=CopyEntity(spark_sprite)
|
||||
spark_orbit_sprite2=CopyEntity(spark_sprite)
|
||||
|
||||
|
||||
ScaleSprite spark_orbit_sprite1,4,4
|
||||
ScaleSprite spark_orbit_sprite2,4,4
|
||||
ScaleSprite spark_sprite,2,2
|
||||
|
||||
EntityColor spark_orbit_sprite1,255,0,0
|
||||
EntityColor spark_orbit_sprite2,255,0,0
|
||||
|
||||
EntityColor spark_sprite,220,255,64
|
||||
ScaleSprite spark_sprite,3,3
|
||||
SpriteViewMode spark_sprite,3
|
||||
|
||||
|
||||
|
||||
For i=1 To 40
|
||||
spark(i)=CopyEntity(spark_sprite)
|
||||
red=Rnd(255);+100
|
||||
green=Rnd(255);+100
|
||||
blue=Rnd(255);+100
|
||||
EntityColor spark(i),128,255,128;,red,green,blue
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
For i=1 To 10
|
||||
EntityParent spark(i),spark_pivot1
|
||||
|
||||
sx#=(Rnd(30)-15)
|
||||
sy#=(Rnd(30)-15)
|
||||
sz#=(Rnd(30)-15)
|
||||
|
||||
PositionEntity spark(i),sx,sy,sz
|
||||
|
||||
Next
|
||||
|
||||
|
||||
For i=11 To 20
|
||||
EntityParent spark(i),spark_pivot2
|
||||
PositionEntity spark(i),Rnd#(30)-15,Rnd#(30)-15,Rnd#(30)-15
|
||||
Next
|
||||
|
||||
|
||||
For i=21 To 30
|
||||
EntityParent spark(i),spark_pivot3
|
||||
PositionEntity spark(i),Rnd#(30)-15,Rnd#(30)-15,5+Rnd#(30)-15
|
||||
Next
|
||||
|
||||
For i=31 To 40
|
||||
EntityParent spark(i),spark_pivot4
|
||||
PositionEntity spark(i),Rnd#(24)-12,Rnd#(24)-12,5+Rnd#(24)-12
|
||||
Next
|
||||
|
||||
EntityColor sun_sprite,220,255,64
|
||||
ScaleSprite sun_sprite,45,45
|
||||
PositionEntity sun_sprite,0,188,5
|
||||
SpriteViewMode sun_sprite,3
|
||||
EntityAlpha sun_sprite,.5
|
||||
|
||||
FreeEntity spark_sprite
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function make_planet()
|
||||
;---------------------------------
|
||||
;Planet
|
||||
;---------------------------------
|
||||
ring=LoadSprite("ring2.bmp",1)
|
||||
PositionEntity ring,0,-180,0
|
||||
ScaleSprite ring,15,15
|
||||
TurnEntity ring,110,0,0
|
||||
SpriteViewMode ring,2
|
||||
EntityAlpha ring,.4
|
||||
ring2=CopyEntity(ring)
|
||||
TurnEntity ring2,-180,0,0
|
||||
EntityAlpha ring2,.2
|
||||
|
||||
|
||||
planet_pivot=CreatePivot()
|
||||
EntityParent ring,planet_pivot
|
||||
EntityParent ring2,planet_pivot
|
||||
|
||||
|
||||
planet=CreateSphere()
|
||||
planet_tex=LoadTexture("io.bmp",9)
|
||||
EntityTexture planet,planet_tex
|
||||
EntityColor planet,222,100,100
|
||||
PositionEntity planet,0,-180,0
|
||||
ScaleEntity planet,4,4,4
|
||||
|
||||
pv=CreatePivot()
|
||||
EntityParent planet,pv
|
||||
PositionEntity planet_pivot,10,0,-10
|
||||
PositionEntity pv,10,0,-10
|
||||
|
||||
planet_light=CreateLight(3)
|
||||
PointEntity planet_light,planet
|
||||
;LightRange planet_light,2
|
||||
PositionEntity planet_light,0,-160,0
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function make_moon()
|
||||
|
||||
moon_texture=LoadTexture("moon.bmp")
|
||||
moon=CreateSphere()
|
||||
EntityTexture moon,moon_texture
|
||||
PositionEntity moon,-10,-195,0
|
||||
moon_pivot=CreatePivot()
|
||||
PositionEntity moon_pivot,10,-180,-10
|
||||
EntityParent moon,moon_pivot
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function make_rocks()
|
||||
;---------------------------------
|
||||
;Rocks
|
||||
;---------------------------------
|
||||
rt=LoadTexture("rock.bmp",8)
|
||||
rock1=LoadMesh("rock.3ds")
|
||||
FitMesh rock1,-1,-1,-1,2,2,2,True
|
||||
EntityTexture rock1,rt
|
||||
ScaleEntity rock1,1,1,1
|
||||
rock_pivot=CreatePivot()
|
||||
PositionEntity rock_pivot,0,190,5
|
||||
|
||||
|
||||
For i=1 To 114 Step 2
|
||||
rock(i)=CopyEntity(rock1)
|
||||
|
||||
Next
|
||||
|
||||
For i=1 To 114 Step 2
|
||||
ry#=(185+Sin(i*Pi)*100+Rnd(25))
|
||||
rx#=(5+Cos(i*Pi)*100+Rnd(20))
|
||||
|
||||
PositionEntity rock(i),rx,ry,Rnd(20)
|
||||
EntityParent rock(i),rock_pivot
|
||||
Next
|
||||
l1=CreateLight()
|
||||
PositionEntity l1,-90,0,10
|
||||
|
||||
|
||||
|
||||
FreeEntity rock1
|
||||
|
||||
;rl=CreateLight()
|
||||
;PositionEntity rl,0,55,0
|
||||
;PositionEntity rock1,0,65,0
|
||||
End Function
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function lens_flare()
|
||||
|
||||
flare1=CreateSphere()
|
||||
flare2=CreateSphere()
|
||||
flare3=CreateSphere()
|
||||
flare4=CreateSphere()
|
||||
|
||||
EntityColor flare1,255,0,0
|
||||
EntityColor flare2,64,255,32
|
||||
EntityColor flare3,32,255,64
|
||||
EntityColor flare4,0,0,255
|
||||
|
||||
ScaleEntity flare1,25,25,25
|
||||
ScaleEntity flare2,6,6,6
|
||||
ScaleEntity flare3,10,10,10
|
||||
ScaleEntity flare4,30,30,30
|
||||
|
||||
EntityAlpha flare1,.1
|
||||
EntityAlpha flare2,.1
|
||||
EntityAlpha flare3,.1
|
||||
EntityAlpha flare4,.09
|
||||
|
||||
HideEntity flare1
|
||||
HideEntity flare2
|
||||
HideEntity flare3
|
||||
HideEntity flare4
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
Function error()
|
||||
SetBuffer FrontBuffer()
|
||||
Color 255,255,255
|
||||
Text 20,20,"ERROR LOADING MEDIA FILES!!! PLEASE INSTALL AGAIN!!"
|
||||
Delay 4000
|
||||
End
|
||||
End Function
|
||||
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,48 @@
|
||||
|
||||
SetGfx()
|
||||
|
||||
Function SetGfx()
|
||||
Print info1$:Print info2$:Print info3$:Print info4$:Print
|
||||
If Windowed3D()
|
||||
yn$=Input$( "Use windowed mode?" )
|
||||
If Left$( Lower$( yn$ ),1 )="y"
|
||||
HidePointer
|
||||
Graphics3D 640,480,0,2
|
||||
SetBuffer BackBuffer()
|
||||
Return
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
Print ""
|
||||
Print "Display drivers:"
|
||||
Print "----------------"
|
||||
For k=1 To CountGfxDrivers()
|
||||
Print k+":"+GfxDriverName$(k)
|
||||
Next
|
||||
Print
|
||||
|
||||
If CountGfxDrivers()>1
|
||||
Repeat
|
||||
driver=Input$( "Display driver (1-"+CountGfxDrivers()+"):" )
|
||||
Until driver>=1 And driver<=CountGfxDrivers()
|
||||
SetGfxDriver driver
|
||||
EndIf
|
||||
|
||||
cnt=CountGfxModes3D()
|
||||
If cnt=0 Print "No 3D Graphics modes detected.":WaitKey:End
|
||||
|
||||
Print ""
|
||||
Print "Display modes:"
|
||||
Print "--------------"
|
||||
For k=1 To CountGfxModes3D()
|
||||
Print k+":"+GfxModeWidth(k)+","+GfxModeHeight(k)+","+GfxModeDepth(k)
|
||||
Next
|
||||
|
||||
Repeat
|
||||
mode=Input$( "Display Mode (1-"+cnt+"):" )
|
||||
Until mode>=1 And mode<=cnt
|
||||
|
||||
Graphics3D GfxModeWidth(mode),GfxModeHeight(mode),GfxModeDepth(mode),1
|
||||
SetBuffer BackBuffer()
|
||||
|
||||
End Function
|
||||