Camera3D Module
Helper functions for 3D Cameras (Perspective projection).
Use these for first-person, third-person, or any 3D game rendering.
Functions and values
| Function or value |
Description
|
|
|
Full Usage:
lookAt position target up fov aspectRatio nearPlane farPlane
Parameters:
Vector3
-
Camera position in world space
target : Vector3
-
Point the camera is looking at
up : Vector3
-
Up vector (typically Vector3.UnitY)
fov : float32
-
Field of view in radians (e.g., MathF.PI / 4.0f)
aspectRatio : float32
-
Width / Height of the viewport
nearPlane : float32
-
Near clipping distance (objects closer are not rendered)
farPlane : float32
-
Far clipping distance (objects farther are not rendered)
Returns: Camera
|
Creates a camera that looks at a target from a position.
Example
val camera: obj
|
Full Usage:
orbit target yaw pitch radius fov aspect near far
Parameters:
Vector3
-
Point the camera orbits around
yaw : float32
-
Horizontal rotation angle in radians
pitch : float32
-
Vertical rotation angle in radians
radius : float32
-
Distance from target
fov : float32
-
Field of view in radians
aspect : float32
-
Aspect ratio
near : float32
-
Near plane
far : float32
-
Far plane
Returns: Camera
|
Creates an orbiting camera using spherical coordinates. Useful for third-person cameras, inspection views, or editor cameras.
|
|
Picture-in-picture overlay. No post-process by default.
|
|
Create a rendering config from a raylib camera. Defaults: fullscreen, no clear, all post-process passes.
|
Full Usage:
screenPointToRay camera screenPos viewportWidth viewportHeight
Parameters:
Camera
-
The camera to compute the ray for.
screenPos : Vector2
-
The screen position in pixels.
viewportWidth : float32
-
Viewport width in pixels.
viewportHeight : float32
-
Viewport height in pixels.
Returns: Ray
|
Creates a ray from screen coordinates for mouse/touch picking. The ray originates at the camera's near plane at the screen position and points into the scene.
|
|
Split-screen bottom half. Clears with given color.
|
|
Split-screen left half. Clears with given color.
|
|
Split-screen right half. Clears with given color.
|
|
Split-screen top half. Clears with given color.
|
Full Usage:
withClear color config
Parameters:
Color
config : Camera3DConfig
Returns: Camera3DConfig
|
Clear with this color before rendering.
|
Full Usage:
withPostProcess passes config
Parameters:
int[]
config : Camera3DConfig
Returns: Camera3DConfig
|
Use only specific post-process pass indices.
|
Full Usage:
withViewport viewport config
Parameters:
Rectangle
config : Camera3DConfig
Returns: Camera3DConfig
|
Set viewport in normalized screen coordinates (0-1).
|
|
Mibo.Raylib