-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path24-Video Texture.sb
More file actions
47 lines (36 loc) · 1.08 KB
/
24-Video Texture.sb
File metadata and controls
47 lines (36 loc) · 1.08 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
;Babylon.sbi - Texture Video
EnableExplicit
IncludeFile "babylon/babylon.sbi"
Global Scene, Screen, ScreenTex, ScreenMat
Declare LoadGame()
Declare RenderGame()
UseModule BJS
InitEngine(@LoadGame())
Procedure LoadGame()
Scene = CreateScene()
If Scene
CreateCamera("camera", 0, 0, 15, #BJS_ArcRotate)
CreateLight("light", 0, 5, 0)
Screen = CreatePlane("screen", 12, 8)
RotateMesh(Screen, 0, 0, 180)
ScreenMat = CreateMaterial("screen")
ScreenTex = LoadVideoTexture("video", "data/video/video3.mp4")
SetMaterialTexture(ScreenMat, #BJS_Diffuse, ScreenTex)
SetMeshMaterial(Screen, ScreenMat)
RenderLoop(@RenderGame())
EndIf
EndProcedure
Procedure RenderGame()
RenderWorld()
EndProcedure
; IDE Options = SpiderBasic 2.20 (Windows - x86)
; CursorPosition = 25
; Folding = -
; WebAppName = Video Texture
; HtmlFilename = videotexture.html
; JavaScriptFilename = videotexture.js
; JavaScriptPath = sb
; iOSAppOrientation = 0
; AndroidAppOrientation = 0
; EnableXP
; CompileSourceDirectory