cloth in Ogre 3d

Everything related to 3D programming
User avatar
Purebasium
New User
New User
Posts: 2
Joined: Fri Mar 14, 2014 5:28 pm

cloth in Ogre 3d

Post by Purebasium »

Here is a small code to make cloth in Purebasic
(It was made from german users (me included) so it´s with german text)

Code: Select all



;PB 5.21
;sowas wie ein Tuch
;
;Orginal Code from bobobo and Purebasium







IncludeFile "Screen3DRequester.pb"

Define.f KeyX, KeyY, MouseX, MouseY
#CameraSpeed = 1


If InitEngine3D(3)
  
  Add3DArchive("Data/Textures", #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Models"  , #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Scripts" , #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Packs/desert.zip", #PB_3DArchive_Zip)
  Add3DArchive("Data/GUI", #PB_3DArchive_FileSystem)
  Parse3DScripts()
  InitSprite()
  InitKeyboard()
  InitMouse()
  
  maxx=30
  maxy=30
  linienan=0
  maus=0
  
  Structure Entities
    id.l
    x.f
    y.f
    z.f
    meshid.l
    matid.l
    scalex.l
    scaley.l
    scalez.l
    phys.l
    lineid1.l
    lineid2.l
  EndStructure
  
  Dim Netz.Entities(maxx,maxy)  ;Netz 10*10
  
    
  NewList ent.Entities()
  Structure balls
    id.l
    time.l
  EndStructure
  
  
  NewList ball.balls()
  
  If Screen3DRequester()
    
    CreateMaterial(0, LoadTexture(0, "Dirt.jpg"))
    CreateMaterial(1, LoadTexture(1, "doscarte.png"))
    CreateCube(0,0.8)
    CreateSphere(1,3)
    infotexture=CreateTexture(#PB_Any,300,150)
    
    fid=LoadFont(#PB_Any,"",8)
    StartDrawing(TextureOutput(infotexture))
      DrawingMode(#PB_2DDrawing_Transparent)
      Box(0,0,100,100,RGBA(0,0,0,0))
      DrawText(0,0,"in der Schleife wird gemalt",#Black)
    StopDrawing()
    CreateMaterial(2,TextureID(infotexture))
    infopanel=CreateEntity(#PB_Any,MeshID(0),MaterialID(2),20,55,0)
    ScaleEntity(infopanel,50,50,5,#PB_Absolute)
    
    EntityPhysicBody(infopanel,#PB_Entity_StaticBody,0.5)
    EntityRenderMode(infopanel,#PB_Entity_DisplaySkeleton)
    ihh=12
    For x=0 To maxx
      For y=0 To maxy
        Netz(x,y)\id=id
        Netz(x,y)\lineid1=id+(maxx*maxy*2)
        Netz(x,y)\lineid2=id+(maxx*maxy*4) ; hier Addition eines Wertes, damit es eindeutig wird (bei größeren Netzen anpassen)
        id+1
        Netz(x,y)\x=x
        Netz(x,y)\y=y
        Netz(x,y)\z=0
        Netz(x,y)\meshid=MeshID(0)
        If y<maxy
          Netz(x,y)\phys=#PB_Entity_BoxBody
          Netz(x,y)\matid=MaterialID(1)
        Else
          If x=maxx-2 Or x=2
            Netz(x,y)\phys=#PB_Entity_StaticBody
            
          Else
            Netz(x,y)\phys=#PB_Entity_BoxBody
          EndIf
          
          Netz(x,y)\matid=MaterialID(0)
        EndIf
        CreateEntity(Netz(x,y)\id,Netz(x,y)\meshid,Netz(x,y)\matid,Netz(x,y)\x,Netz(x,y)\y,Netz(x,y)\z)
        EntityPhysicBody(Netz(x,y)\id,Netz(x,y)\phys,0.1,0.001,0.001)
        EntityRenderMode(Netz(x,y)\id,#PB_Entity_CastShadow)
      Next y
    Next x
    For x=0 To maxx-1
      For y=0 To maxy
        pj=PointJoint(#PB_Any,EntityID(Netz(x,y)\id),0,0,0,EntityID(Netz(x+1,y)\id),-1,0,0)
        SetJointAttribute(pj,#PB_PointJoint_Damping,1)
        SetJointAttribute(pj,#PB_PointJoint_Tau,1)
      Next y
    Next x
    For x=0 To maxx
      For y=0 To maxy-1
        pj=PointJoint(#PB_Any,EntityID(Netz(x,y)\id),0,0,0,EntityID(Netz(x,y+1)\id),0,-1,0)
        SetJointAttribute(pj,#PB_PointJoint_Damping,1)
        SetJointAttribute(pj,#PB_PointJoint_Tau,1)
      Next y
    Next x
    
    CreateCamera(0, 0, 0, 100, 100)
    MoveCamera(0, 63, 38, 38,1)
    CameraLookAt(0, 15, 15, 0)
    SkyBox("desert07.jpg")
    wg.f=-0.981
    WorldGravity(wg)
    CreateLight(0, RGB(255, 255, 255), 0, 1, 0,#PB_Light_Directional )  ; Red light
    LightDirection(0, -1, -0.5, -0.25)
    geschw=200      
           
    Repeat
      Screen3DEvents()
      WorldGravity(wg)
      WorldShadows(#PB_Shadow_Additive)
      If linienan=1
      For x=0 To maxx-1
        For y=0 To maxy
          CreateLine3D(netz(x,y)\lineid1,EntityX(Netz(x,y)\id),EntityY(Netz(x,y)\id),
                       EntityZ(Netz(x,y)\id),#Red,EntityX(Netz(x+1,y)\id),
                       EntityY(Netz(x+1,y)\id),EntityZ(Netz(x+1,y)\id),#Green)
        Next y
      Next x
      For x=0 To maxx
        For y=0 To maxy-1
          CreateLine3D(netz(x,y)\lineid2,EntityX(Netz(x,y)\id),EntityY(Netz(x,y)\id),
                       EntityZ(Netz(x,y)\id),#Blue,EntityX(Netz(x,y+1)\id),
                       EntityY(Netz(x,y+1)\id),EntityZ(Netz(x,y+1)\id),#Yellow)
        Next y
      Next x
      EndIf
      
      If ExamineMouse()
        MouseX = -MouseDeltaX() * 1* 0.05
        MouseY = -MouseDeltaY() * 1 * 0.05
      EndIf
      
      If ExamineKeyboard()
        If KeyboardPushed(#PB_Key_Space)
              ApplyEntityImpulse(Netz(maxx/2,maxy/2)\id,0,0,-20)
        EndIf
        If KeyboardReleased(#PB_Key_B)
          bally=0
        EndIf
        If KeyboardPushed(#PB_Key_F)
          geschw+1
        EndIf
        If KeyboardPushed(#PB_Key_G)
          geschw-1
          If geschw<10
            geschw=10
          EndIf
          
        EndIf
        
        If KeyboardPushed(#PB_Key_B) And bally=0
          bally=1
         AddElement(Ball())
         ball()\id=CreateEntity(#PB_Any,MeshID(1),MaterialID(0),CameraX(0),CameraY(0),CameraZ(0))
         ball()\time=500
          EntityPhysicBody(ball()\id, #PB_Entity_SphereBody,10,1,1 )
          EntityRenderMode(ball()\id,#PB_Entity_CastShadow)
          ApplyEntityImpulse(ball()\id,CameraDirectionX(0)*geschw,CameraDirectionY(0)*geschw,CameraDirectionZ(0)*geschw)
        EndIf
        If pause <>1 ;die runout zeit darf bei pause nicht weiterlaufen
        ForEach ball()
          ball()\time-1
          If ball()\time<1
            FreeEntity(ball()\id)
            DeleteElement(ball())
          EndIf
        Next
        EndIf 
        
        If KeyboardPushed(#PB_Key_Subtract)
          wg.f=wg.f-0.1
        EndIf
        If KeyboardPushed(#PB_Key_Add)
          wg.f=wg.f+0.1
        EndIf
        
        If KeyboardPushed(#PB_Key_R)
          For x= 0 To maxx
            For y=0 To maxy
              MoveEntity(Netz(x,y)\id,x,y,z,#PB_Absolute)
            Next y
          Next x
        EndIf
        If KeyboardReleased(#PB_Key_M) 
          ;Hier wir es hässlich
          If maus = 0 : maus=1 :Else: maus =0 :EndIf
          ShowGUI(255,maus) 
          ExamineDesktops()
          MouseLocate(DesktopWidth(0)/2, DesktopHeight(0)/2)
        EndIf
        
        InputEvent3D(MouseX(), MouseY(), MouseButton(#PB_MouseButton_Left))
        If KeyboardReleased(#PB_Key_P) 
          If pause = 0 : pause=1 :Else: pause =0 :EndIf
        EndIf
        
        If KeyboardPushed(#PB_Key_Left)
          KeyX = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Right)
          KeyX = #CameraSpeed 
        Else
          KeyX = 0
        EndIf
        
        If KeyboardPushed(#PB_Key_Up)
          KeyY = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Down)
          KeyY = #CameraSpeed 
        Else
          KeyY = 0
        EndIf
        
      EndIf
      
      If maus =0 ;only rotate the camera if the mouse looked
      RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
      EndIf
      
      MoveCamera  (0, KeyX, 0, KeyY)
      
      If pause =1
      RenderWorld(0)
      EndIf
        
      If pause <>1
        RenderWorld()
      EndIf 
      
      StartDrawing(TextureOutput(infotexture))
        
        DrawingMode(#PB_2DDrawing_AllChannels | #PB_2DDrawing_AlphaBlend)
        Box(0,0,300,300,RGBA(200,200,255,32))
        ih=0
        FrontColor(RGBA(255,255,0,255))
        BackColor(RGBA(200,200,255,64))
        DrawingFont(FontID(fid))
        DrawText(0,ih,"FPS:"+Str(Engine3DFrameRate(#PB_Engine3D_Current)))
        ih+ihh
        DrawText(0,ih,"Tuch besteht derzeit aus ")
        ih+ihh:DrawText(0,ih,Str(maxy*maxx)+" Elementen")
        ih+ihh:DrawText(0,ih,"Space : Tuch piksen")
        ih+ihh:DrawText(0,ih,"B: Einen Ball in Sichtrichtung schießen")
        ih+ihh:DrawText(0,ih,"ADD/SUB (Nummernblock): Gravitation ändern")
        ih+ihh:DrawText(0,ih,"Gravitaion :"+StrF(wg,3))
        ih+ihh:DrawText(0,ih,"R: Reset des Tuches")
        ih+ihh:DrawText(0,ih,"M: Maus anzeigen/verdecken")
        ih+ihh:DrawText(0,ih,"Ball Geschw.(f+,g-):"+Str(geschw))
        ih+ihh:DrawText(0,ih,"P: Pause")
        
      StopDrawing()
      CreateMaterial(2,TextureID(infotexture))
      MaterialBlendingMode(2, #PB_Material_AlphaBlend)
      SetEntityMaterial(infopanel,MaterialID(2))
      RotateEntity(infopanel,0,-1,0,#PB_Relative)
      
      Screen3DStats()
      FlipBuffers()
      
    Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
  EndIf
  
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf

End





I´ll hope you enjoy it.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: cloth in Ogre 3d

Post by DK_PETER »

Hey Purebasium.

I like it! Thank you.
It is somewhat 'demanding' in its current form, but the
cloth idea is good. I will definately expand on the cloth
concept, when I have time to spare.


Edit: Setting subsystem to OpenGL increases the speed.
Last edited by DK_PETER on Fri Mar 14, 2014 10:17 pm, edited 2 times in total.
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
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: cloth in Ogre 3d

Post by Samuel »

It is a nice example, but the speed is definitely on the slower side. Removing the shadows will speed things up a little.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: cloth in Ogre 3d

Post by applePi »

very nice demo, thank you. seems good year for the PureBasic 3D engine.
it runs smooth on my new i5 desktop with geforce GT 520
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: cloth in Ogre 3d

Post by applePi »

i have tried it again with the reflective cubemapping , (there is an example cubemapping.pb). and i think it is great, i have disabled the shadow to speed it more as suggested by samuel.
please allow me to repost your example with cubeMapping and disabling the shadow so the others can try it easily
a thousand of variations can be done with the cubemapping
i run it on i5 desktop with GT 520 card on windows xp
press Space to push the cloth, move and rotate with keys and mouse

Code: Select all

;PB 5.21
;sowas wie ein Tuch
;
;Orginal Code from bobobo and Purebasium







IncludeFile "Screen3DRequester.pb"

Define.f KeyX, KeyY, MouseX, MouseY
#CameraSpeed = 1


If InitEngine3D(3)
  
  Add3DArchive("Data/Textures", #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Models"  , #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Scripts" , #PB_3DArchive_FileSystem)
  Add3DArchive("Data/Packs/desert.zip", #PB_3DArchive_Zip)
  Add3DArchive("Data/GUI", #PB_3DArchive_FileSystem)
  Parse3DScripts()
  InitSprite()
  InitKeyboard()
  InitMouse()
  
    
  maxx=30
  maxy=30
  linienan=0
  maus=0
  
  Structure Entities
    id.l
    x.f
    y.f
    z.f
    meshid.l
    matid.l
    scalex.l
    scaley.l
    scalez.l
    phys.l
    lineid1.l
    lineid2.l
  EndStructure
  
  Dim Netz.Entities(maxx,maxy)  ;Netz 10*10
  
    
  NewList ent.Entities()
  Structure balls
    id.l
    time.l
  EndStructure
  
  
  NewList ball.balls()
  
  If Screen3DRequester()
    CubeMapTexture = CreateCubeMapTexture(#PB_Any, 256, 256, "CubeMapTexture") ; Should be the same name than in 'CubeMap.material' file
    GetScriptMaterial(1,"CubeMapMaterial") ; Should be the same name than in 'CubeMap.material' file
    SetMaterialColor(1, #PB_Material_SelfIlluminationColor, $FFFFFF)
  
    CreateMaterial(0, LoadTexture(0, "Dirt.jpg"))
    ;CreateMaterial(1, LoadTexture(1, "doscarte.png"))
    CreateCube(0,0.8)
    CreateSphere(1,3)
    infotexture=CreateTexture(#PB_Any,300,150)
    
    fid=LoadFont(#PB_Any,"",8)
    StartDrawing(TextureOutput(infotexture))
      DrawingMode(#PB_2DDrawing_Transparent)
      Box(0,0,100,100,RGBA(0,0,0,0))
      DrawText(0,0,"in der Schleife wird gemalt",#Black)
    StopDrawing()
    CreateMaterial(2,TextureID(infotexture))
    infopanel=CreateEntity(#PB_Any,MeshID(0),MaterialID(2),20,55,0)
    ScaleEntity(infopanel,50,50,5,#PB_Absolute)
    
    EntityPhysicBody(infopanel,#PB_Entity_StaticBody,0.5)
    EntityRenderMode(infopanel,#PB_Entity_DisplaySkeleton)
    ihh=12
    For x=0 To maxx
      For y=0 To maxy
        Netz(x,y)\id=id
        Netz(x,y)\lineid1=id+(maxx*maxy*2)
        Netz(x,y)\lineid2=id+(maxx*maxy*4) ; hier Addition eines Wertes, damit es eindeutig wird (bei gr??eren Netzen anpassen)
        id+1
        Netz(x,y)\x=x
        Netz(x,y)\y=y
        Netz(x,y)\z=0
        Netz(x,y)\meshid=MeshID(0)
        If y<maxy
          Netz(x,y)\phys=#PB_Entity_BoxBody
          Netz(x,y)\matid=MaterialID(1)
        Else
          If x=maxx-2 Or x=2
            Netz(x,y)\phys=#PB_Entity_StaticBody
            
          Else
            Netz(x,y)\phys=#PB_Entity_BoxBody
          EndIf
          
          Netz(x,y)\matid=MaterialID(0)
        EndIf
        CreateEntity(Netz(x,y)\id,Netz(x,y)\meshid,Netz(x,y)\matid,Netz(x,y)\x,Netz(x,y)\y,Netz(x,y)\z)
        EntityPhysicBody(Netz(x,y)\id,Netz(x,y)\phys,0.1,0.001,0.001)
        ;EntityRenderMode(Netz(x,y)\id,#PB_Entity_CastShadow)
      Next y
    Next x
    For x=0 To maxx-1
      For y=0 To maxy
        pj=PointJoint(#PB_Any,EntityID(Netz(x,y)\id),0,0,0,EntityID(Netz(x+1,y)\id),-1,0,0)
        SetJointAttribute(pj,#PB_PointJoint_Damping,1)
        SetJointAttribute(pj,#PB_PointJoint_Tau,1)
      Next y
    Next x
    For x=0 To maxx
      For y=0 To maxy-1
        pj=PointJoint(#PB_Any,EntityID(Netz(x,y)\id),0,0,0,EntityID(Netz(x,y+1)\id),0,-1,0)
        SetJointAttribute(pj,#PB_PointJoint_Damping,1)
        SetJointAttribute(pj,#PB_PointJoint_Tau,1)
      Next y
    Next x
    
    CreateCamera(0, 0, 0, 100, 100)
    MoveCamera(0, 63, 38, 38,1)
    CameraLookAt(0, 15, 15, 0)
    SkyBox("desert07.jpg")
    wg.f=-0.981
    WorldGravity(wg)
    CreateLight(0, RGB(255, 255, 255), 0, 1, 0,#PB_Light_Directional )  ; Red light
    LightDirection(0, -1, -0.5, -0.25)
    geschw=200      
           
    Repeat
      Screen3DEvents()
      WorldGravity(wg)
      ;WorldShadows(#PB_Shadow_Additive)
      If linienan=1
      For x=0 To maxx-1
        For y=0 To maxy
          CreateLine3D(netz(x,y)\lineid1,EntityX(Netz(x,y)\id),EntityY(Netz(x,y)\id),
                       EntityZ(Netz(x,y)\id),#Red,EntityX(Netz(x+1,y)\id),
                       EntityY(Netz(x+1,y)\id),EntityZ(Netz(x+1,y)\id),#Green)
        Next y
      Next x
      For x=0 To maxx
        For y=0 To maxy-1
          CreateLine3D(netz(x,y)\lineid2,EntityX(Netz(x,y)\id),EntityY(Netz(x,y)\id),
                       EntityZ(Netz(x,y)\id),#Blue,EntityX(Netz(x,y+1)\id),
                       EntityY(Netz(x,y+1)\id),EntityZ(Netz(x,y+1)\id),#Yellow)
        Next y
      Next x
      EndIf
      
      If ExamineMouse()
        MouseX = -MouseDeltaX() * 1* 0.05
        MouseY = -MouseDeltaY() * 1 * 0.05
      EndIf
      
      If ExamineKeyboard()
        If KeyboardPushed(#PB_Key_Space)
              ApplyEntityImpulse(Netz(maxx/2,maxy/2)\id,0,0,-20)
        EndIf
        If KeyboardReleased(#PB_Key_B)
          bally=0
        EndIf
        If KeyboardPushed(#PB_Key_F)
          geschw+1
        EndIf
        If KeyboardPushed(#PB_Key_G)
          geschw-1
          If geschw<10
            geschw=10
          EndIf
          
        EndIf
        
        If KeyboardPushed(#PB_Key_B) And bally=0
          bally=1
         AddElement(Ball())
         ball()\id=CreateEntity(#PB_Any,MeshID(1),MaterialID(0),CameraX(0),CameraY(0),CameraZ(0))
         ball()\time=500
          EntityPhysicBody(ball()\id, #PB_Entity_SphereBody,10,1,1 )
          EntityRenderMode(ball()\id,#PB_Entity_CastShadow)
          ApplyEntityImpulse(ball()\id,CameraDirectionX(0)*geschw,CameraDirectionY(0)*geschw,CameraDirectionZ(0)*geschw)
        EndIf
        If pause <>1 ;die runout zeit darf bei pause nicht weiterlaufen
        ForEach ball()
          ball()\time-1
          If ball()\time<1
            FreeEntity(ball()\id)
            DeleteElement(ball())
          EndIf
        Next
        EndIf 
        
        If KeyboardPushed(#PB_Key_Subtract)
          wg.f=wg.f-0.1
        EndIf
        If KeyboardPushed(#PB_Key_Add)
          wg.f=wg.f+0.1
        EndIf
        
        If KeyboardPushed(#PB_Key_R)
          For x= 0 To maxx
            For y=0 To maxy
              MoveEntity(Netz(x,y)\id,x,y,z,#PB_Absolute)
            Next y
          Next x
        EndIf
        If KeyboardReleased(#PB_Key_M) 
          ;Hier wir es h?sslich
          If maus = 0 : maus=1 :Else: maus =0 :EndIf
          ShowGUI(255,maus) 
          ExamineDesktops()
          MouseLocate(DesktopWidth(0)/2, DesktopHeight(0)/2)
        EndIf
        
        InputEvent3D(MouseX(), MouseY(), MouseButton(#PB_MouseButton_Left))
        If KeyboardReleased(#PB_Key_P) 
          If pause = 0 : pause=1 :Else: pause =0 :EndIf
        EndIf
        
        If KeyboardPushed(#PB_Key_Left)
          KeyX = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Right)
          KeyX = #CameraSpeed 
        Else
          KeyX = 0
        EndIf
        
        If KeyboardPushed(#PB_Key_Up)
          KeyY = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Down)
          KeyY = #CameraSpeed 
        Else
          KeyY = 0
        EndIf
        
      EndIf
      
      If maus =0 ;only rotate the camera if the mouse looked
      RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
      EndIf
      
      MoveCamera  (0, KeyX, 0, KeyY)
      
      If pause =1
      RenderWorld(0)
      EndIf
        
      If pause <>1
        RenderWorld()
      EndIf 
      
      StartDrawing(TextureOutput(infotexture))
        
        DrawingMode(#PB_2DDrawing_AllChannels | #PB_2DDrawing_AlphaBlend)
        Box(0,0,300,300,RGBA(200,200,255,32))
        ih=0
        FrontColor(RGBA(255,255,0,255))
        BackColor(RGBA(200,200,255,64))
        DrawingFont(FontID(fid))
        DrawText(0,ih,"FPS:"+Str(Engine3DFrameRate(#PB_Engine3D_Current)))
        ih+ihh
        DrawText(0,ih,"Tuch besteht derzeit aus ")
        ih+ihh:DrawText(0,ih,Str(maxy*maxx)+" Elementen")
        ih+ihh:DrawText(0,ih,"Space : Tuch piksen")
        ih+ihh:DrawText(0,ih,"B: Einen Ball in Sichtrichtung schie?en")
        ih+ihh:DrawText(0,ih,"ADD/SUB (Nummernblock): Gravitation ?ndern")
        ih+ihh:DrawText(0,ih,"Gravitaion :"+StrF(wg,3))
        ih+ihh:DrawText(0,ih,"R: Reset des Tuches")
        ih+ihh:DrawText(0,ih,"M: Maus anzeigen/verdecken")
        ih+ihh:DrawText(0,ih,"Ball Geschw.(f+,g-):"+Str(geschw))
        ih+ihh:DrawText(0,ih,"P: Pause")
        
      StopDrawing()
      CreateMaterial(2,TextureID(infotexture))
      MaterialBlendingMode(2, #PB_Material_AlphaBlend)
      SetEntityMaterial(infopanel,MaterialID(2))
      RotateEntity(infopanel,0,-1,0,#PB_Relative)
      
      Screen3DStats()
      FlipBuffers()
      
    Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
  EndIf
  
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf

End
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: cloth in Ogre 3d

Post by Bananenfreak »

Looks like sequined Cloth. Nice applePi :D
Image
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: cloth in Ogre 3d

Post by Fred »

TextureOutput() is quite slow, it should be avoided in the main loop.
User avatar
Purebasium
New User
New User
Posts: 2
Joined: Fri Mar 14, 2014 5:28 pm

Re: cloth in Ogre 3d

Post by Purebasium »

You can post it where ever you like.

It Looks really cool with cubemapping.
eths
User
User
Posts: 20
Joined: Wed Mar 17, 2004 11:00 am

Re: cloth in Ogre 3d

Post by eths »

I'm afraid it doesn't work on OSX.
Post Reply