Skip to main content

Python 3D Framework

Project description

Basilisk Engine

image Basilisk is a 3D engine package for python that can create visualizations, simulations, and video games from the comfort and ease of Python. Basilisk is designed for quick and effortless development with a powerful backend engine that supports larger scaled projects. The engine automatically handles all graphics and physics for you, with the option to inject your own functionality if desired.

mud foil mud mud

Quick Start

Installation

To start, you will need to install Basilisk engine. To do so, simply run the following command from the terminal:

pip install basilisk-engine

Now you will be able to import the package with import basilisk. Since Basilisk is fully open source, you also have the option to download the code from the github if you prefer.

First Program

Every Basilisk prorgam has an Engine that handles the high level functionality of Basilisk. Additionally, you will want a Scene which will hold the application's objects.

# Import basilisk into the project. We use bsk as convention
import basilisk as bsk 

# Initialize objects for the engine and the scene
engine = bsk.Engine()
scene = bsk.Scene(engine)

Here we will introduce an important paradigm of Basilisk's design that will reoccur throughout this guide. Most things used in Basilisk are objects, such as the engine and the scene. You can use these objects wherever and whenever you want. In this instance, we pass the engine to the scene, so that Basilisk knows the scene is part of the engine. Now, we will set up the game loop. We use a while loop by convention.

while engine.running: # Check that the engine is still running
    scene.update()    # Update the scene and render to temporary frame
    engine.update()   # Update the engine and render to the screen 

The engine.running attribute is just a boolean flag that tells the user if the engine is running still and has not been stoped for any reason. The scene.update() function will render the scene and handle physics/object updates for the tick. The engine.update() function will tell the engine to handle all frame rendering and inputs.

With just these six lines of code, you can now run the python file, and you should see something like this. Note that you can free your mouse by pressing escape (this behavior can be changed if desired see input section in Engine reference page):

mud

Congratulations you have finished your first Basilisk program!

Full Code

For clarity, here is the full code used in this tutorial.

import basilisk as bsk

engine = bsk.Engine()
scene = bsk.Scene(engine)

while engine.running:
    scene.update()
    engine.update()

Learn more at the Basilisk Engine Website

Webpage still under development.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

basilisk_engine-0.1.42.tar.gz (73.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basilisk_engine-0.1.42-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file basilisk_engine-0.1.42.tar.gz.

File metadata

  • Download URL: basilisk_engine-0.1.42.tar.gz
  • Upload date:
  • Size: 73.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for basilisk_engine-0.1.42.tar.gz
Algorithm Hash digest
SHA256 a5fb4d0c09f6920ab03cbfd7907723bdd2ebd4dda8c9ddbf299e6e4f5f4ad58e
MD5 668ae719717e14867556c1c265148472
BLAKE2b-256 d6a5e1f0ae8ff046de5f44697f2f1b8f43f595f7d9e8e8c8cf74d7920591dac5

See more details on using hashes here.

File details

Details for the file basilisk_engine-0.1.42-py3-none-any.whl.

File metadata

File hashes

Hashes for basilisk_engine-0.1.42-py3-none-any.whl
Algorithm Hash digest
SHA256 70e7d5fd6601c067218c05e0ba204bd0ea31254846eff74feeeab01dd8bfc630
MD5 5c87c10dee373fca9e95a30464c0c923
BLAKE2b-256 2a8c0b9cba1ab84f6ca4d2a3d1cc47711c33cbf9bb0b4abb622db0cad3e177bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page