Need help with CameraProjectionMode

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Need help with CameraProjectionMode

Post 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
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Need help with CameraProjectionMode

Post 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.
Please correct my english
http://purebasic.developpez.com/
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Need help with CameraProjectionMode

Post by Samuel »

Thanks for letting me know. I was worried that I did something stupid.
Post Reply