Wierd hidden torus while camera move around it; bug?

Everything related to 3D programming
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Wierd hidden torus while camera move around it; bug?

Post by Psychophanta »

What is the cause about this issue?
The torus is randomly hidden while camera is moving around :? :x

BUG? :?:

Code: Select all

InitEngine3D()
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,800,600,"Titulo$",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,1,0,0,#PB_Screen_WaitSynchronization)
CreateTexture(0, 128, 128)
StartDrawing(TextureOutput(0))
Box(0, 0, 128, 128, $FFFFFF)
StopDrawing()
CreateTexture(1, 128, 128)
StartDrawing(TextureOutput(1))
Box(0, 0, 128, 128, $000000)
Box(0, 0, 64, 64, $BBBBBB)
Box(64, 64, 64, 64, $BBBBBB)
StopDrawing()

CreateMaterial(1, TextureID(1))
SetMaterialColor(1, #PB_Material_AmbientColor, $FFFFFF):ScaleMaterial(1,0.01,0.1,0)
CreateMaterial(3, TextureID(0))
SetMaterialColor(3, #PB_Material_AmbientColor, $0077FF)

#radio=4000
CreateTorus(1,#radio,80,3,1000):TransformMesh(1,0,0,0,1,1,1,90,0,0,0)
sol.i=CreateEntity(#PB_Any, MeshID(1), MaterialID(1),0,0,0)

CreateCube(2,40)
support = CreateEntity(#PB_Any, MeshID(2), MaterialID(3))
MoveEntity(support, 0, 10-#radio, 0, #PB_Absolute)

#Camara=0:#Pivotcamara=0
CreateCamera(#Camara, 0, 0, 100, 100):CameraRange(#Camara,0.1,10000):CameraBackColor(#Camara,$181911)
CreateNode(#Pivotcamara,0,10-#radio,0)
AttachNodeObject(#Pivotcamara,CameraID(#Camara))
MoveCamera(#Camara,0,0,800,#PB_Absolute)

CreateLight(0,RGB(160,160,255),50,-4000,50)

Repeat
  ExamineMouse():ExamineKeyboard()
  lmb.b=MouseButton(#PB_MouseButton_Left):rmb.b=MouseButton(#PB_MouseButton_Right):mmb.b=MouseButton(#PB_MouseButton_Middle)
  mdx.f=MouseDeltaX()/10:mdy.f=MouseDeltaY()/10:mdz.f=MouseWheel()
  CursorX.f=MouseX():CursorY.f=MouseY()
  Eventodeventana.i=WindowEvent()
  If mdx.f Or mdy.f Or mdz.f
    If mmb.b
      MoveCamera(#Camara,mdx.f,-mdy.f,0,#PB_Local)
    Else
      RotateNode(#Pivotcamara,-mdy.f,-mdx.f,0,#PB_Relative)
      If mdz
        MoveCamera(#Camara,0,0,-mdz.f*30,#PB_Local)
      EndIf
    EndIf
  EndIf
  RenderWorld()
  FlipBuffers():Delay(13)
Until KeyboardPushed(#PB_Key_Escape)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jul 09, 2015 9:07 am

Re: Wierd hidden torus while camera move around it; bug?

Post by pf shadoko »

after
TransformMesh(1,0,0,0,1,1,1,90,0,0,0)
just add:
UpdateMeshBoundingBox(1)

(i will add this automatically in the next version)
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Wierd hidden torus while camera move around it; bug?

Post by Psychophanta »

I see :idea:
So, it is a feature, not bug, :P
Thanks pf shadoko :)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
Post Reply