Giter Site home page Giter Site logo

pyopengl-playground's Introduction

Python OpenGL Playground

What is this project supposed to be?

This is a (in development) 3D rendering application with a physics engine on the (ever so distant) horizon. The purpose of this project is for self learning and a reference for any future related projects.

Features (unchecked features are still in progress, or on the backlog)

  • Imports file

  • Open a window (Pygame Window)

  • Application loop that exits when window is closed

  • Shader class, which provides an interface for compiling, using, modifying uniform variables

  • Simple shaders, allowing for rendering using vertex data and

  • Projection matrix and model matrix for displaying vertices. (Needs to be incapsulated in another object)

  • Mesh class, which allocates vertex, texture, normal data in the VBO which is bound to a VAO (maybe add element array objects)

  • Ability to import .obj files (finicky, only consistently works with exported blender objects) through a mesh object

  • Material class, used for importing image data and sampled by the vertex texture data

  • 'Camera' class, allowing for the user to traverse the 3D world.

  • Basic lighting

  • Additional model loading

  • Advanced OpenGL stuff (cool shaders n stuff, skyboxes, frame culling, anti aliasing )

  • Manipulation of vertices during runtime for physics purposes (soft body, destructible, etc.)

  • Properly defined engine with an API to add objects, including adding components, etc.

  • A seperate window to edit and manage objects.

Physics engine?

At a certain point along the project, physics will slowly be integrated into this project. This will include the following:

  • Dynamic input (gravity, user input) to manipulate position, velocity, acceleration, jerk

  • Object properties, such as mass, associated with specific materials.

  • Collision detection - This one requires a lot more effort, but will most likely contain:

    • Detection between any two convex 3D objects (maybe concave as well?)
    • Research and implementation for data structures that optimize which objects need to be checked for collisions
    • Primitive and advanced collision detection systems may be implemented, depending on what is wanted
  • Collision solving -> solve collisions when they occur, depending on an objects properties

  • Rigid body collision /simulation

  • Soft body simulation

General Architecture Idea

The main idea for an end product would be as follows (pseudocode mockup):

Start Program;

// Initialization
	// Binding the physics engine with the 3D renderer makes a 'game' engine
	Game = GameManager();

	// This creates a generic game object. It contains no properties but is now
	//    tracked by the game engine. The user can now add properties to the object
	Game.add(GameObject("cube"), "name")

	// May not be the best method, but there will be a method for directly
	//   Accessing objects so that they can be modified.
	let Cube = Game.getObject("name")

	// The cube will now be rendered by the rendering engine. The box mesh is a
	//    default mesh that allows for some predefined properties
	Cube.addBoxMesh()


	// This is a general demonstration of an idea for how components of a game
	//    object can be modified.

	// Maybe not the best method, but this method allows for the user to add a
	// 		texture to the mesh. Not adding a texture will leave it gray.
	Cube.getComponent("BoxMesh").addTexture("img")

	// This is a predefined collider that will be managed by the physics system
	//  	Gravity is turned on by default. The cube will fall indefintely
	Cube.addBoxCollider()

	// More research is needed here, but the general idea is that a rigid body
	//    is what responds to collisions
	Cube.getComponent("BoxCollider").addRigidBody()

// Looping

	// The user would likely use this themselves, the game engine does not use this stuff by itself
	DeltaTime = ComputeDeltaTime()

	// Dynamics
	Game.HandleEvents()

// more stuff to come

pyopengl-playground's People

Contributors

conno732 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.