

pf shadoko wrote: Wed Jul 03, 2024 2:57 pmCode: Select all
InitEngine3D():InitSprite():InitKeyboard():InitMouse() ExamineDesktops() OpenWindow(0, 0,0, DesktopWidth(0)*0.8,DesktopHeight(0)*0.8, "CreateShader - [Esc] quit",#PB_Window_ScreenCentered) OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0) image.s="C:\Users\Guillot\Downloads\Insta360_X4_Smaple_image.jpg" If FileSize(image)<0:MessageRequester("!", "enter 360 panoramic image path (above)"):CallDebugger:EndIf Add3DArchive(GetPathPart(image), #PB_3DArchive_FileSystem):Parse3DScripts() LoadTexture(0,GetFilePart(image)) CreateCamera(0, 0, 0, 100, 100):MoveCamera(0,0,3,-6):CameraLookAt(0,0,0,0) CreateMaterial(0,TextureID(0)) DisableMaterialLighting(0,1) MaterialCullingMode(0,#PB_Material_AntiClockWiseCull) MaterialFilteringMode(0,#PB_Material_Anisotropic) CreateSphere(0,1000,64,64) CreateEntity(0,MeshID(0),MaterialID(0)) Define.f MouseX,Mousey,fov=45 Repeat While WindowEvent():Wend ExamineKeyboard() ExamineMouse() MouseX = -MouseDeltaX() * 0.05 MouseY = -MouseDeltaY() * 0.05 FOV-MouseWheel()*5:If fov<10:fov=10:ElseIf fov>90:fov=90:EndIf CameraFOV(0,fov) RotateCamera(0, MouseY, MouseX, 0, #PB_Relative) RenderWorld() FlipBuffers() Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(3)