-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path17-BumpTexture.sb
More file actions
48 lines (40 loc) · 1.25 KB
/
17-BumpTexture.sb
File metadata and controls
48 lines (40 loc) · 1.25 KB
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
;Babylon.sbi - Bump Texture
EnableExplicit
IncludeFile "babylon/babylon.sbi"
UseModule BJS
Global Scene, Camera, Sphere, Material, Texture
Declare LoadGame()
Declare RenderGame()
InitEngine(@LoadGame())
Procedure LoadGame()
Scene = CreateScene()
If Scene
Camera = CreateCamera("camera", 0, 10, 20, #BJS_ArcRotate)
ClearScene(RGB(128, 128, 128))
CreateLight("light", 0, 20, 0, 0.8)
Sphere = CreateSphere("sphere", 8)
Material = CreateMaterial("empty")
Texture = LoadTexture("Data/textures/floor.png")
SetMaterialTexture(Material, #BJS_Diffuse, Texture)
Texture = LoadTexture("Data/textures/floor_bump.PNG")
SetMaterialTexture(Material, #BJS_Bump, Texture)
SetMeshMaterial(Sphere, Material)
RenderLoop(@RenderGame())
EndIf
EndProcedure
Procedure RenderGame()
RotateMesh(Sphere, 0.5, 0.5, 0.5, #PB_Relative)
RenderWorld()
EndProcedure
; IDE Options = SpiderBasic 2.20 (Windows - x86)
; CursorPosition = 25
; Folding = -
; WebAppName = Bump texture
; HtmlFilename = bumptexture.html
; JavaScriptFilename = bumptexture.js
; JavaScriptPath = sb
; CopyJavaScriptLibrary
; iOSAppOrientation = 0
; AndroidAppOrientation = 0
; EnableXP
; CompileSourceDirectory