MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
model.py File Reference

Interactive Python MXVK model loader and renderer. More...

Go to the source code of this file.

Classes

class  model.ModelWindow

Namespaces

namespace  model

Functions

np.ndarray model.identity_matrix ()
np.ndarray model.look_at_matrix (tuple[float, float, float] eye, tuple[float, float, float] center, tuple[float, float, float] up)
int model.main ()
list[float] model.matrix_values (np.ndarray matrix)
np.ndarray model.normalize_vector (np.ndarray vector)
 model.parse_args ()
tuple[int, int] model.parse_resolution (str value)
np.ndarray model.perspective_matrix (float fov_radians, float aspect, float near_plane, float far_plane)
np.ndarray model.rotation_y_matrix (float angle)
np.ndarray model.scale_matrix (float x, float y, float z)
np.ndarray model.translation_matrix (float x, float y, float z)

Variables

 model.EXAMPLE_DIR = Path(__file__).resolve().parent

Detailed Description

Interactive Python MXVK model loader and renderer.

Loads an OBJ or MXMOD asset, builds NumPy transform matrices, and renders the model with mouse-controlled camera interaction. The resource path selects the shader and texture data directory used by the example.

Running the example

python3 python-examples/model/model.py --resolution 1280x720
python3 python-examples/model/model.py --input models/pyramid.obj --enable-vsync

Controls

  • Drag with the left mouse button: orbit the camera.
  • Mouse wheel: zoom.
  • Escape: exit.

Lifecycle

ModelWindow creates and renders AbstractModel through the Python binding, then calls model cleanup before releasing the Vulkan window.

Definition in file model.py.