Page 1 of 1

Need help with CameraProjectionMode

Posted: Sun Nov 11, 2012 12:47 am
by Samuel
I created a cylinder and I'm trying to turn off the perspective,but it seems like the Orthographic mode shows 3D depth. I've tried switching
between the two modes, to see if there was even a slight difference, but as far as I can tell they are both displaying perspective.
It would be great if someone could point out what i did wrong.

Code: Select all

;**************************************************************
;********PRESS ESCAPE TO EXIT**********************
;**************************************************************


ExamineDesktops()

  If InitEngine3D()
    Else
      MessageRequester("Information", "ERROR///Could not InitEngine3D", 0) 
    End
  EndIf
  If  InitSprite()
    Else
      MessageRequester("Information", "ERROR///Could not InitSprite", 0)     
    End
  EndIf  
  If InitKeyboard()
    Else
      MessageRequester("Information", "ERROR///Could not InitKeyboard", 0)     
    End
  EndIf  

  
DeskWid=DesktopWidth(0)-200
DeskHei=DesktopHeight(0)-200

If OpenWindow(0, 0, 0, DeskWid, DeskHei, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
 If OpenWindowedScreen(WindowID(0), 0, 0, DeskWid, DeskHei, 0, 0, 0)

   
    CreateTexture(2, 512, 512)
    StartDrawing(TextureOutput(2))
       Box(0, 0, 512, 512 ,RGB(255,100,20))
    StopDrawing()
       
    CreateTexture(1, 512, 512)
    StartDrawing(TextureOutput(1))
      Box(0, 0, 512, 512 ,RGB(200,200,200))
    StopDrawing()
       
    CreateMaterial(2, TextureID(1))
    CreateMaterial(3, TextureID(2))
    
    MaterialAmbientColor(3, RGB(0,0,0))
    
     CreatePlane(3, 30000, 30000, 100, 100, 100, 100)
     CreateEntity(3,MeshID(3),MaterialID(3), 0, -1000, 0)
        CreateLight(0, RGB(55, 55, 55), 0, 0 , 1000)
        CreateLight(1, RGB(200,200, 200), 0, 0 , -1000)

     CreateCamera(0, 0, 0, 100, 100)
     CameraLocate(0, 0, 0, 1250)
     CameraLookAt(0, 0, 0, 0)
     CameraBackColor(0, RGB(55, 55, 55)) 
 
;*******************************************************************************
     ;CameraProjectionMode(0, #PB_Camera_Perspective)
     CameraProjectionMode(0, #PB_Camera_Orthographic)
     
     CreateCylinder(0, 50, 1000)
     CreateEntity(1, MeshID(0), MaterialID(2))
     RotateEntity(1, 95, 0, 0 , #PB_Relative)
    
 Repeat
      Event = WaitWindowEvent(0) 
      
      If ExamineKeyboard()
      EndIf

      RenderWorld()
      FlipBuffers()
      Delay(10)
      
  Until KeyboardPushed(#PB_Key_Escape)
 EndIf
EndIf    
End

Re: Need help with CameraProjectionMode

Posted: Mon Nov 12, 2012 10:15 am
by Comtois
Samuel wrote:I created a cylinder and I'm trying to turn off the perspective,but it seems like the Orthographic mode shows 3D depth. I've tried switching
between the two modes, to see if there was even a slight difference, but as far as I can tell they are both displaying perspective.
It would be great if someone could point out what i did wrong.
you did nothing wrong, it doesnt work for the moment.

Re: Need help with CameraProjectionMode

Posted: Mon Nov 12, 2012 10:38 am
by Samuel
Thanks for letting me know. I was worried that I did something stupid.