-
Notifications
You must be signed in to change notification settings - Fork 109
/
Skybox.bb
74 lines (67 loc) · 1.45 KB
/
Skybox.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Function sky_CreateSky(filename$,parent%=0)
Local sky
Restore sky_SkyboxData
sky = CreateMesh(parent)
For face = 1 To 6
Read direction$
Local fname$ = filename$ + direction$ + ".jpg"
If FileType(fname$)=1
Local b = LoadBrush_Strict(fname$,%110001)
s = CreateSurface(sky,b)
For vert = 1 To 4
Read x,y,z,u,v
AddVertex s,x,y,z,u,v
Next
AddTriangle s,0,1,2
AddTriangle s,0,2,3
FreeBrush b
EndIf
Next
FlipMesh sky
EntityFX sky,1+8
EntityOrder sky,1000
Return sky
End Function
Function UpdateSky()
PositionEntity Sky, EntityX(Camera),EntityY(Camera),EntityZ(Camera), True
End Function
Function Update1499Sky()
PositionEntity NTF_1499Sky, EntityX(Camera),EntityY(Camera),EntityZ(Camera), True
End Function
;-----------------------------------------------------------------------
;Data
;-----------------------------------------------------------------------
.sky_SkyboxData
Data "_back"
Data -1,+1,-1,0,0
Data +1,+1,-1,1,0
Data +1,-1,-1,1,1
Data -1,-1,-1,0,1
Data "_left"
Data +1,+1,-1,0,0
Data +1,+1,+1,1,0
Data +1,-1,+1,1,1
Data +1,-1,-1,0,1
Data "_front"
Data +1,+1,+1,0,0
Data -1,+1,+1,1,0
Data -1,-1,+1,1,1
Data +1,-1,+1,0,1
Data "_right"
Data -1,+1,+1,0,0
Data -1,+1,-1,1,0
Data -1,-1,-1,1,1
Data -1,-1,+1,0,1
Data "_up"
Data -1,+1,+1,0,0
Data +1,+1,+1,1,0
Data +1,+1,-1,1,1
Data -1,+1,-1,0,1
Data "_down"
Data -1,-1,-1,1,0
Data +1,-1,-1,1,1
Data +1,-1,+1,0,1
Data -1,-1,+1,0,0
;~IDEal Editor Parameters:
;~F#1#1B#1F
;~C#Blitz3D