Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #sbsize = 4096
- Enumeration textures
- #texSBFront
- #texSBBack
- #texSBLeft
- #texSBRight
- #texSBUp
- #texSBDown
- EndEnumeration
- Enumeration materials
- #matSBFront
- #matSBBack
- #matSBLeft
- #matSBRight
- #matSBUp
- #matSBDown
- EndEnumeration
- Enumeration meshes
- #meshSBFront
- #meshSBBack
- #meshSBLeft
- #meshSBRight
- #meshSBUp
- #meshSBDown
- EndEnumeration
- Enumeration entities
- #entSBFront
- #entSBBack
- #entSBLeft
- #entSBRight
- #entSBUp
- #entSBDown
- EndEnumeration
- Enumeration nodes
- #skybox
- EndEnumeration
- Procedure customSkyBox(template.s)
- Protected ratio.l,name.s,ext.s
- ext = StringField(template,2,".")
- name = StringField(template,1,".")
- ; cleaning
- If IsNode(#skybox)
- FreeNode(#skybox)
- FreeEntity(#entSBFront) : FreeMaterial(#matSBFront) : FreeMesh(#meshSBFront) : FreeTexture(#texSBFront)
- FreeEntity(#entSBBack) : FreeMaterial(#matSBBack) : FreeMesh(#meshSBBack) : FreeTexture(#texSBBack)
- FreeEntity(#entSBLeft) : FreeMaterial(#matSBLeft) : FreeMesh(#meshSBLeft) : FreeTexture(#texSBLeft)
- FreeEntity(#entSBRight) : FreeMaterial(#matSBRight) : FreeMesh(#meshSBRight) : FreeTexture(#texSBRight)
- FreeEntity(#entSBUp) : FreeMaterial(#matSBUp) : FreeMesh(#meshSBUp) : FreeTexture(#texSBUp)
- FreeEntity(#entSBDown) : FreeMaterial(#matSBDown) : FreeMesh(#meshSBDown) : FreeTexture(#texSBDown)
- EndIf
- LoadTexture(#texSBFront,name + "_FR." + ext)
- ratio = #sbsize/TextureWidth(#texSBFront)
- CreateMaterial(#matSBFront,TextureID(#texSBFront))
- DisableMaterialLighting(#matSBFront,#True)
- CreatePlane(#meshSBFront,TextureWidth(#texSBFront),TextureHeight(#texSBFront),1,1,1,1)
- CreateEntity(#entSBFront,MeshID(#meshSBFront),MaterialID(#matSBFront))
- ScaleEntity(#entSBFront,ratio,1,ratio)
- RotateEntity(#entSBFront,-90,0,180,#PB_Absolute)
- MoveEntity(#entSBFront,0,0,-#sbsize/2)
- LoadTexture(#texSBBack,name + "_BK." + ext)
- ratio = #sbsize/TextureWidth(#texSBBack)
- CreateMaterial(#matSBBack,TextureID(#texSBBack))
- DisableMaterialLighting(#matSBBack,#True)
- CreatePlane(#meshSBBack,TextureWidth(#texSBBack),TextureHeight(#texSBBack),1,1,1,1)
- CreateEntity(#entSBBack,MeshID(#meshSBBack),MaterialID(#matSBBack))
- ScaleEntity(#entSBBack,ratio,1,ratio)
- RotateEntity(#entSBBack,-90,0,0,#PB_Absolute)
- MoveEntity(#entSBBack,0,0,#sbsize/2)
- LoadTexture(#texSBLeft,name + "_LF." + ext)
- ratio = #sbsize/TextureWidth(#texSBLeft)
- CreateMaterial(#matSBLeft,TextureID(#texSBLeft))
- DisableMaterialLighting(#matSBLeft,#True)
- CreatePlane(#meshSBLeft,TextureWidth(#texSBLeft),TextureHeight(#texSBLeft),1,1,1,1)
- CreateEntity(#entSBLeft,MeshID(#meshSBLeft),MaterialID(#matSBLeft))
- ScaleEntity(#entSBLeft,ratio,1,ratio)
- RotateEntity(#entSBLeft,-90,0,-90,#PB_Absolute)
- MoveEntity(#entSBLeft,-#sbsize/2,0,0)
- LoadTexture(#texSBRight,name + "_RT." + ext)
- ratio = #sbsize/TextureWidth(#texSBRight)
- CreateMaterial(#matSBRight,TextureID(#texSBRight))
- DisableMaterialLighting(#matSBRight,#True)
- CreatePlane(#meshSBRight,TextureWidth(#texSBRight),TextureHeight(#texSBRight),1,1,1,1)
- CreateEntity(#entSBRight,MeshID(#meshSBRight),MaterialID(#matSBRight))
- ScaleEntity(#entSBRight,ratio,1,ratio)
- RotateEntity(#entSBRight,-90,0,90,#PB_Absolute)
- MoveEntity(#entSBRight,#sbsize/2,0,0)
- LoadTexture(#texSBUp,name + "_UP." + ext)
- ratio = #sbsize/TextureWidth(#texSBUp)
- CreateMaterial(#matSBUp,TextureID(#texSBUp))
- DisableMaterialLighting(#matSBUp,#True)
- CreatePlane(#meshSBUp,TextureWidth(#texSBUp),TextureHeight(#texSBUp),1,1,1,1)
- CreateEntity(#entSBUp,MeshID(#meshSBUp),MaterialID(#matSBUp))
- ScaleEntity(#entSBUp,ratio,1,ratio)
- RotateEntity(#entSBUp,-180,-180,0,#PB_Absolute)
- MoveEntity(#entSBUp,0,#sbsize/2,0)
- LoadTexture(#texSBDown,name + "_DN." + ext)
- ratio = #sbsize/TextureWidth(#texSBDown)
- CreateMaterial(#matSBDown,TextureID(#texSBDown))
- DisableMaterialLighting(#matSBDown,#True)
- CreatePlane(#meshSBDown,TextureWidth(#texSBDown),TextureHeight(#texSBDown),1,1,1,1)
- CreateEntity(#entSBDown,MeshID(#meshSBDown),MaterialID(#matSBDown))
- ScaleEntity(#entSBDown,ratio,1,ratio)
- RotateEntity(#entSBDown,0,-180,0,#PB_Absolute)
- MoveEntity(#entSBDown,0,-#sbsize/2,0)
- CreateNode(#skybox)
- AttachNodeObject(#skybox,EntityID(#entSBFront))
- AttachNodeObject(#skybox,EntityID(#entSBBack))
- AttachNodeObject(#skybox,EntityID(#entSBLeft))
- AttachNodeObject(#skybox,EntityID(#entSBRight))
- AttachNodeObject(#skybox,EntityID(#entSBUp))
- AttachNodeObject(#skybox,EntityID(#entSBDown))
- EndProcedure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement