The room...

Everything related to 3D programming
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

The room...

Post by DK_PETER »

Create a folder named: texture.
I would have made it with pure code..I just couldn't get it quite right...
So these two images must be saved in the texture folder.

save as: lightning.jpg
http://postimg.org/image/r9j2r7mcl/
And
save as: flare.jpg
http://postimg.org/image/6b1xjlogf/

Have fun...

Code:

Code: Select all

;-------------------------------------------
; Yet another mish mash
; BY DK_PETER
; Room with lights on...
;-------------------------------------------
UseJPEGImageDecoder()
UsePNGImageDecoder()

If InitEngine3D() = 0
  MessageRequester("Unable to start 3D engine", "Examine log for clues")
  End
EndIf
If InitSprite() = 0
  MessageRequester("Unable to open a screen??", "Something is wrong...")
  End
EndIf  

InitKeyboard()

Structure Vector3
  x.f
  y.f
  z.f
EndStructure

Structure _object
  id.i
  ma.i
  ma2.i
  ms.i
  tx.i[4]
EndStructure

Structure _Room
  floor._object
  walls._object[3]
  ceil._object
  beamsRight._object[10]
  beamsLeft._object[10]
  vBeamsLeft._object[5]
  vBeamsRight._object[5]
  ball._object
  tube._object[3]
  smallball._object
EndStructure

Structure _pars
  id.i
  ma.i
  tx.i
EndStructure

Declare   Normalize(*V.Vector3)
Declare.i CreateTube(meshID.i, outerRadius.f, innerRadius.f, height.f, numSegBase.i=16, numSegHeight.i=1)
Declare.i MakeRoom()

Global twink._pars, r._Room, el.i, lg.i, sp.f = 0.01, ScaleStart.f = 1.0, NewMat.i = #False

OpenWindow(0, 0, 0, 1024, 768, "Star trek horizon example - (DK_PETER) - Escape = Quit", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 1024, 768)
Add3DArchive("texture", #PB_3DArchive_FileSystem)
WorldShadows(#PB_Shadow_TextureAdditive)

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 0.4, 6)
lg1 = CreateLight(#PB_Any, $F6FFFF, 0.5, 1, -2,#PB_Light_Spot)
LightDirection(lg1, -0.2, 0.1, 1)

MakeRoom()

Repeat
  
  Repeat
    ev = WindowEvent()
  Until ev = 0
  
  RotateEntity(r\ball\id, 0, -1.5, 0,#PB_Relative)
  If sp < 5 : sp + 0.01 : EndIf
  If sp >= 5 And ScaleStart < 60 
    ScaleStart + 1
    ScaleEntity(r\smallball\id, ScaleStart, ScaleStart, ScaleStart, #PB_Absolute)
    If ScaleStart >= 50 And NewMat = #False
      SetEntityMaterial(r\ball\id, MaterialID(r\ball\ma2))
      NewMat = #True
      HideParticleEmitter(twink\id,  #False)
    EndIf
  EndIf
  RotateEntity(r\tube[0]\id, sp, 0, 0, #PB_Relative)
  RotateEntity(r\tube[1]\id, 0, sp, sp, #PB_Relative)
  RotateEntity(r\tube[2]\id, 0, 0, sp, #PB_Relative)
  
  RenderWorld()
  
  ExamineKeyboard()  
  
  FlipBuffers()
  
Until KeyboardPushed(#PB_Key_Escape)

Procedure.i MakeRoom()
  Protected x.i, y.i, c.i, ra.f
  ;Floor
  With r\floor
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Box(0, 0, 1024, 1024, $FF7D7B7C)
    DrawingMode(#PB_2DDrawing_Outlined)
    For y = 0 To 1024 Step 48
      For x = 0 To 1024 Step 48
        color = Random(50,0)
        Box(x, y, 48, 48, RGBA(color,color,color,255))
      Next x
    Next y
    DrawingMode(#PB_2DDrawing_AlphaBlend|#PB_2DDrawing_Gradient)
    FrontColor($33000000)
    BackColor($FF000000)
    CircularGradient(512, 768, 80)
    Circle(512, 768, 80)
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    SetMaterialAttribute(\ma, #PB_Material_DepthWrite, #True)
    \ms = CreatePlane(#PB_Any, 5, 15, 1, 1, 1, 1)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(\ma), 0, 0, 0)
  EndWith
  
  ;Ceil
  With r\ceil
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Box(0, 0, 1024, 1024, $FF7D7B7C)
    DrawingMode(#PB_2DDrawing_Outlined)
    For y = 0 To 1024 Step 24
      For x = 0 To 1024 Step 24
        color = Random(50,0)
        Box(x, y, 48, 48, RGBA(color,color,color,255))
      Next x
    Next y
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Circle(512, 768, 120, $FF000000)
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    MaterialCullingMode(\ma, #PB_Material_NoCulling)
    SetMaterialAttribute(\ma, #PB_Material_DepthWrite, #True)
    \ms = CreatePlane(#PB_Any, 5, 15, 1, 1, 1, 1)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(\ma), 0, 2.2, 0)
  EndWith
  
  With r\walls[0]
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    Box(0, 0, 1024, 1024, $FF151414)
    For y = 0 To 1024 Step 64
      If Mod(y,256) = 0
        Box(0, y-2, 1024, 5, $898989)
      Else
        Box(0, y-3, 1024, 5, $757575)
      EndIf
    Next y
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    AddMaterialLayer(\ma, TextureID(\tx[0]))
    SetMaterialAttribute(\ma, #PB_Material_DepthWrite, #True)
    \ms = CreatePlane(#PB_Any, 5, 15, 1, 1, 1, 1)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(\ma), -2.5, 0, 0)
    
    RotateEntity(\id, 0, 0, -90)
    r\walls[1]\id = CopyEntity(\id, #PB_Any)
    RotateEntity(r\walls[1]\id, 0, 0, 90)
    MoveEntity(r\walls[1]\id, 2.5, 0, 0)
    r\walls[2]\id = CopyEntity(\id, #PB_Any)
    RotateEntity(r\walls[2]\id, 90, 0, 90)
    MoveEntity(r\walls[2]\id, 0, 0, -6)
  EndWith
  
  ;Base_beams
  With r\beamsLeft[0] ;tilted
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Box(0, 0, 1024, 1024, $FF151414)
    Box(0, 450, 1024, 50, $88F9B21B)
    Box(0, 550, 1024, 50, $88F9B21B)
    Box(0, 650, 1024, 50, $88F9B21B)
    Box(0, 465, 1024, 25, $FFF9D01B)
    Box(0, 565, 1024, 25, $FFF9D01B)
    Box(0, 665, 1024, 25, $FFF9D01B)
    Box(0, 470, 1024, 10, $FFF9F31B)
    Box(0, 570, 1024, 10, $FFF9F31B)
    Box(0, 670, 1024, 10, $FFF9F31B)
    StopDrawing()
    \tx[1] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[1]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Box(0, 470, 180, 20, $FFFFE758)
    Box(0, 570, 180, 20, $FFFFE758)
    Box(0, 670, 180, 20, $FFFFE758)
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    AddMaterialLayer(\ma, TextureID(\tx[0]))
    AddMaterialLayer(\ma, TextureID(\tx[1]), #PB_Material_Add)
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    ScrollMaterial(\ma, 2, 0, #PB_Material_Animated,2)
    \ms = CreateCube(#PB_Any, 0.2)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(\ma))
    ScaleEntity(\id, 1, 7, 1)
    RotateEntity(\id, 0, 0, 40,#PB_Absolute)
    MoveEntity(\id, -2.2, 0.4, -5)
  EndWith
  
  With r\vbeamsLeft[0] ;vertical
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Box(0, 0, 1024, 1024, $FF151414)
    Box(448, 0, 128, 1024, $88F9B21B)
    For y = 0 To 1024 Step 48
      Box(480, y+9, 64, 30, $BBEDFF58)
      Box(500, y+18, 24, 10, $FFFFFFFF)
    Next y
    StopDrawing()
    \tx[1] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[1]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    For y = 0 To 1024 Step 150
      Box(496, y, 30, 30, $BBEDFF58)
    Next y
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    AddMaterialLayer(\ma, TextureID(\tx[0]))
    AddMaterialLayer(\ma, TextureID(\tx[1]), #PB_Material_Add)
    ScrollMaterial(\ma, 0, -0.3, #PB_Material_Animated,2)
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    \ms = CreateCube(#PB_Any, 0.2)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(\ma))
    ScaleEntity(\id, 1, 12, 1)
    MoveEntity(\id, -2.2, 1.2, -6)
  EndWith
  c = 1
  For x = -4 To 2 Step 2
    r\vbeamsLeft[c]\id = CopyEntity(r\vbeamsLeft[0]\id, #PB_Any)
    r\vbeamsRight[c]\id = CopyEntity(r\vbeamsLeft[0]\id, #PB_Any)
    MoveEntity(r\vbeamsLeft[c]\id, -2.2, 1.2, x)
    MoveEntity(r\vbeamsRight[c]\id, 2.2, 1.2, x)
    
    r\beamsLeft[c]\id = CopyEntity(r\beamsLeft[0]\id, #PB_Any)
    r\beamsRight[c]\id = CopyEntity(r\beamsLeft[0]\id, #PB_Any)
    MoveEntity(r\beamsLeft[c]\id, -2.2, 0.4, x+1)
    MoveEntity(r\beamsRight[c]\id, 2.2, 0.4, x+1)
    RotateEntity(r\beamsLeft[c]\id, 0, 0, 40,#PB_Absolute)   
    RotateEntity(r\beamsRight[c]\id, 0, 0, -40,#PB_Absolute)   
    c+1
  Next x
  
  For x = -4 To 2 Step 2 ;ceiling
    r\beamsLeft[c]\id = CopyEntity(r\beamsLeft[0]\id, #PB_Any)
    r\beamsRight[c]\id = CopyEntity(r\beamsLeft[0]\id, #PB_Any)
    MoveEntity(r\beamsLeft[c]\id, -2.2, 1.8, x+1)
    MoveEntity(r\beamsRight[c]\id, 2.2, 1.8, x+1)
    RotateEntity(r\beamsLeft[c]\id, 0, 0, -40,#PB_Absolute)   
    RotateEntity(r\beamsRight[c]\id, 0, 0, 40,#PB_Absolute)   
    c+1
  Next x
  
  With r\ball
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    DrawingMode(#PB_2DDrawing_AlphaBlend)
    Box(0, 0, 1024, 1024, $FF000000)
    For x = 0 To 1024 Step 30
      For y = 0 To 1024 Step 30
        Box(x, y, 15, 15, $FFFFBD5B)
      Next y
    Next x
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    RotateMaterial(\ma, 45,#PB_Material_Fixed)
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    SetMaterialAttribute(\ma, #PB_Material_DepthWrite, #True)
    \ms = CreateSphere(#PB_Any, 0.5, 32, 32)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(r\ball\ma), 0, 1, -4)
    \tx[1] = LoadTexture(#PB_Any, "lightning.jpg")
    \ma2 = CreateMaterial(#PB_Any, TextureID(\tx[1]))
    MaterialBlendingMode(r\ball\ma2, #PB_Material_Add)
    AddMaterialLayer(r\ball\ma2, TextureID(r\ball\tx[1]),#PB_Material_Modulate)
    ScaleMaterial(r\ball\ma2, 1.5, 1.5, 0)
    ScaleMaterial(r\ball\ma2, 2.1, 2.1, 0)
    ScrollMaterial(r\ball\ma2, 0.03, 0.1, #PB_Material_Animated,0)
    ScrollMaterial(r\ball\ma2, -0.2, -0.01, #PB_Material_Animated,1)
  EndWith
  
  With r\smallball
    \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
    StartDrawing(TextureOutput(\tx[0]))
    Box(0, 0, 1024, 1024, $FFFFFF)
    StopDrawing()
    \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
    AddMaterialLayer(\ma, TextureID(\tx[0]), #PB_Material_Add)
    RotateMaterial(\ma, 45,#PB_Material_Fixed)
    MaterialFilteringMode(\ma, #PB_Material_Anisotropic, 8)
    SetMaterialAttribute(\ma, #PB_Material_DepthWrite, #True)
    \ms = CreateSphere(#PB_Any, 0.2, 32, 32)
    \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(r\smallball\ma), 0, 1, -4)
  EndWith
  
  ra = 0.7
  For x = 0 To 2
    With r\tube[x]
      \tx[0] = CreateTexture(#PB_Any, 1024, 1024)
      StartDrawing(TextureOutput(\tx[0]))
      DrawingMode(#PB_2DDrawing_AlphaBlend)
      Box(0, 0, 1024, 1024, $FF438EBB)
      Box(0, 500, 524, 24, $FF2A93D2)
      StopDrawing()
      \ma = CreateMaterial(#PB_Any, TextureID(\tx[0]))
      \ms = CreateTube(#PB_Any, ra, ra-0.1, 0.1, 36, 2)
      \id = CreateEntity(#PB_Any, MeshID(\ms), MaterialID(\ma), 0, 1, -4)
      RotateEntity(\id, 90, 0, 90)
      ra + 0.13
    EndWith
  Next x
  
  With twink
    \tx = LoadTexture(#PB_Any, "flare.jpg")
    \ma = CreateMaterial(#PB_Any, TextureID(\tx))
    MaterialBlendingMode(\ma, #PB_Material_Add)
    \id = CreateParticleEmitter(#PB_Any,1, 1, 1, #PB_Particle_Box, 0, -1, -3.8)
    ParticleMaterial(\id, MaterialID(\ma))
    ParticleEmissionRate(\id, 500)
    ParticleEmitterDirection(\id, 0, 1, 0)
    ParticleSize(\id, 0.5, 1.2)
    ParticleTimeToLive(\id, 0.4, 0.7)
    ParticleVelocity(\id, 0.001, 0.002)
    ParticleSpeedFactor(\id, 0.2)
    HideParticleEmitter(\id, #True)
  EndWith
EndProcedure

Procedure.i CreateTube(meshID.i, outerRadius.f, innerRadius.f, height.f, numSegBase.i=16, numSegHeight.i=1)
  
  Protected  Normal.Vector3, returnMesh.i
  
  If meshID = -1
    returnMesh = CreateMesh(#PB_Any)
  Else
    returnMesh = meshID
    CreateMesh(returnMesh)
  EndIf
  
  If numSegBase < 1
    numSegBase = 1
  EndIf
  
  If numSegHeight < 1
    numSegHeight = 1
  EndIf
  
  deltaAngle.f = #PI*2 / numSegBase
  deltaHeight.f = height / numSegHeight
  height2.f = height / 2.0
  offset = 0
  
  For i = 0 To numSegHeight
    For j = 0 To numSegBase
      
      x0.f = outerRadius * Cos(j*deltaAngle)
      z0.f = outerRadius * Sin(j*deltaAngle)
      
      Normal\x = x0
      Normal\y = 0
      Normal\z = z0
      Normalize(@Normal)
      
      MeshVertexPosition(x0, i*deltaHeight-height2, z0)
      MeshVertexNormal(Normal\x, Normal\y, Normal\z)
      MeshVertexTextureCoordinate(j / numSegBase, i / numSegHeight)
      
      If  i <> numSegHeight
        
        MeshIndex(offset + numSegBase + 1)
        MeshIndex(offset)
        MeshIndex(offset + numSegBase)
        MeshIndex(offset + numSegBase + 1)
        MeshIndex(offset + 1)
        MeshIndex(offset)
      EndIf
      offset + 1
    Next
  Next   
  
  For i = 0 To numSegHeight
    For j = 0 To numSegBase
      
      x0.f = innerRadius * Cos(j*deltaAngle)
      z0.f = innerRadius * Sin(j*deltaAngle)
      
      Normal\x = x0
      Normal\y = 0
      Normal\z = z0
      Normalize(@Normal)
      
      MeshVertexPosition(x0, i*deltaHeight-height2, z0)
      MeshVertexNormal(Normal\x, Normal\y, Normal\z)
      MeshVertexTextureCoordinate(j / numSegBase, i / numSegHeight)
      
      If  i <> numSegHeight
        
        MeshIndex(offset + numSegBase + 1)
        MeshIndex(offset + numSegBase)
        MeshIndex(offset)
        MeshIndex(offset + numSegBase + 1)
        MeshIndex(offset)
        MeshIndex(offset + 1)
      EndIf
      offset + 1
    Next
  Next   
  
  ;low cap
  For j = 0 To numSegBase
    
    x0.f = innerRadius * Cos(j*deltaAngle)
    z0.f = innerRadius * Sin(j*deltaAngle)
    MeshVertexPosition(x0, -height2, z0)
    MeshVertexNormal(0, -1, 0)
    MeshVertexTextureCoordinate(j / numSegBase, 1)
    
    x0 = outerRadius * Cos(j*deltaAngle)
    z0 = outerRadius * Sin(j*deltaAngle)
    MeshVertexPosition(x0, -height2, z0)
    MeshVertexNormal(0, -1, 0)
    MeshVertexTextureCoordinate(j / numSegBase, 0)
    
    If j <> numSegBase
      
      MeshIndex(offset)
      MeshIndex(offset + 1)
      MeshIndex(offset + 3)
      MeshIndex(offset + 2)
      MeshIndex(offset)
      MeshIndex(offset + 3)
    EndIf
    offset + 2
  Next
  
  ;high cap
  For j = 0 To numSegBase
    
    x0.f = innerRadius * Cos(j*deltaAngle)
    z0.f = innerRadius * Sin(j*deltaAngle)
    MeshVertexPosition(x0, height2, z0)
    MeshVertexNormal(0, 1, 0)
    MeshVertexTextureCoordinate(j / numSegBase, 0)
    
    x0 = outerRadius * Cos(j*deltaAngle)
    z0 = outerRadius * Sin(j*deltaAngle)
    MeshVertexPosition(x0, height2, z0)
    MeshVertexNormal(0, 1, 0)
    MeshVertexTextureCoordinate(j / numSegBase, 1)
    
    If j <> numSegBase
      
      MeshIndex(offset + 1)
      MeshIndex(offset)
      MeshIndex(offset + 3)
      MeshIndex(offset)
      MeshIndex(offset + 2)
      MeshIndex(offset + 3)
    EndIf
    offset + 2
  Next
  FinishMesh(#True)
  ProcedureReturn returnMesh
EndProcedure   

Procedure Normalize(*V.Vector3)
  Define.f magSq, oneOverMag
  
  magSq = *V\x * *V\x + *V\y * *V\y + *V\z * *V\z
  If magsq > 0
    oneOverMag = 1.0 / Sqr(magSq)
    *V\x * oneOverMag
    *V\y * oneOverMag
    *V\z * oneOverMag
  EndIf
EndProcedure
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

Re: The room...

Post by Hades »

Runs perfect for me (as you probably had suspected I must have messed up last time)

And as a big fan of 3d graphics and sci-fi I strongly approve this! :D
Joris
Addict
Addict
Posts: 890
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: The room...

Post by Joris »

I saved the 2 jpg's created the folder "E:\texture\" placed both inside that folder but still get errors on these :
\tx[1] = LoadTexture(#PB_Any, "E:\texture\lightning.jpg")

They don't become loaded.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

Re: The room...

Post by Hades »

I've had trouble with that before, too. PB doesn't work like that, sadly. You either need to use the code as posted her, and save it next to the texture folder, or put the full path to the folder into Add3DArchive(), so in your case: Add3DArchive("E:\texture", #PB_3DArchive_FileSystem), and change back LoadTexture(#PB_Any, "E:\texture\lightning.jpg") to LoadTexture(#PB_Any, "lightning.jpg").
Joris
Addict
Addict
Posts: 890
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: The room...

Post by Joris »

Ok that helped. Thanks.
Nice room.

I had to change Compiler options too => RenderWorld() needs OpenGL (on XP here) otherwhise an IMA.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: The room...

Post by heartbone »

Been waiting for someone else to report this but....
I can't get this one to run on my XP - PB 5.42 LTS installation.

[12:59:37] Waiting for executable to start...
[12:59:39] Executable type: Windows - x86 (32bit, Unicode)
[12:59:39] Executable started.
[12:59:41] [ERROR] TheRoom.pb (Line: 287)
[12:59:41] [ERROR] The specified #Texture is not initialised.

287 \ma2 = CreateMaterial(#PB_Any, TextureID(\tx[1]))

I even added OpenGL to the library Subsystem
Keep it BASIC.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: The room...

Post by applePi »

@heartbone, apparently the code can't find the lightning.jpg image, create a folder and name it as texture in the same place as the code. i have winxp 32 and the room works great like in the star wars rooms.
note: the folder texture : is defined in line 61 as the folder to search for the pictures or any files in the current code path.
Add3DArchive("texture", #PB_3DArchive_FileSystem)
if you replace "texture" with "." then the code will search the current code path for the wanted pictures
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: The room...

Post by heartbone »

applePi wrote:@heartbone, apparently the code can't find the lightning.jpg image, create a folder and name it as texture in the same place as the code. i have winxp 32 and the room works great like in the star wars rooms.
note: the folder texture : is defined in line 61 as the folder to search for the pictures or any files in the current code path.
Add3DArchive("texture", #PB_3DArchive_FileSystem)
if you replace "texture" with "." then the code will search the current code path for the wanted pictures
That last substitution did the trick.
Thanks applePi.
And thanks for the nice demo DK_PETER. Of course it goes into the hard drive PB demo folder.
Keep it BASIC.
infratec
Always Here
Always Here
Posts: 7699
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: The room...

Post by infratec »

Only if someone else stumble across a crash at RenderWorld():

I needed to use opengl as subsystem on my PC.

Bernd
Post Reply