Code Monkey home page Code Monkey logo

sketchbook's Introduction


Play it here!

Sketchbook

3D rendering and physics library for game-like projects on the web, featuring a few conventional gameplay mechanics and basic 3D models. Currently not production-ready. Until 1.0 is released, anything can break at any point and backwards compatibility with previous versions isn't guaranteed.

It's called Sketchbook because I'm sketching in all the gameplay mechanics I've known for years and always speculated on how I would go about creating them from scratch. Mostly it's just my little playground which I'm happy to share with people.

Built on three.js and cannon.js.

Features

  • World
    • Three.js scene
    • Cannon.js physics
    • Variable timescale
    • Frame skipping
    • FXAA anti-aliasing
    • Custom damped-spring simulation
  • Characters
    • Third-person camera
    • Raycast character controller with capsule collisions
    • General state system
    • Character AI

Not yet implemented

  • Vehicles
    • Cars
    • Airplanes
    • Helicopters

All planned features can be found in the project pages.

Usage

This creates a fullscreen canvas, initializes the physics and rendering, adds a character and lets you control him.

let world = new Sketchbook.World();

let player = new Sketchbook.Character({
    position: new THREE.Vector3(1.13, 3, -2.2),
});
LoadCharacterModel(player);
world.add(player);
player.takeControl();

Check out the examples to learn specifics about using Sketchbook.

Installation

Simply import the library in your project, along with provided build of cannon.js and a three.js version of your choice, and you're ready to go.

<script src="three.min.js"></script>
<script src="cannon.min.js"></script> <!-- Only use provided build, official package is extremely outdated! -->
<script src="sketchbook.min.js"></script>

A NPM package and @types are on the way, which should make this a whole lot easier.

Contributing

Please do!

I appreciate all help, be it suggestions, issues or even pull requests. Just make sure to create PRs on the dev branch, which is the most up to date one.

sketchbook's People

Contributors

swift502 avatar

Watchers

James Cloos avatar Scott Southard 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.