Coder Social home page Coder Social logo

zacharycarter / voodoo Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 3.0 30.01 MB

3D game programming and rapid prototyping library.

License: MIT License

Janet 1.22% GLSL 8.31% C 75.26% Shell 3.69% Python 0.49% JavaScript 3.93% CSS 0.49% HTML 6.59%
3d 3d-graphics c game game-development games janet janet-lang webgpu wgpu

voodoo's Introduction

voodoo

voodoo

voodoo is a 3D game programming library written in C.

voodoo exposes an API that is intended to be invoked via scripts written in Janet.

voodoo is presently focused on creating games for the browser. Support for more platforms is planned.

voodoo is very much WIP.

Screenshot reflecting current state of renderer

ss0.png

Video demonstration

voodoo.mp4
(def actions {:up 0
              :down 1
              :left 2
              :right 3
              :num 4})

(def bindings @{(actions :up) [input/key/up input/gamepad/dpad/up]
                (actions :down) [input/key/down input/gamepad/dpad/down]
                (actions :left) [input/key/left input/gamepad/dpad/left]
                (actions :right) [input/key/right input/gamepad/dpad/right]})

(def state @{:camera nil
             :doll-asset: nil
             :player: nil})

(defn init []
  (set (state :doll-asset) (asset/load "doll" "/assets/dolls/ozz_skin.doll"))
  (set (state :camera) (cam/orbit @{:min-dist 1.0
                                  :max-dist 50.0
                                  :center @[0.0 0.0 0.0]
                                  :distance 5.0
                                  :latitude 45.0
                                  :longitude 45.0
                                  :nearz 0.01
                                  :farz 2000.0}))

  (v3d/cube @[0.0 5.0 0.0] @[1.0 1.0 1.0])
  (v3d/cube @[0.0 -0.9375 0.0] @[5.0 0.125 5.0])
  (set (state :player) (game/object @[0.0 0.0 0.0] @[1.0 1.0 1.0] @[0.0 0.0 0.0 0.0]))
  (game/object/add-component (state :player) component/doll (v3d/doll/create (state :doll-asset)))
  (loop [[action binding] :pairs bindings]
    (if (not= (get binding 0) input/invalid) (input/bind input/layer/user (get binding 0) action))
    (if (not= (get binding 1) input/invalid) (input/bind input/layer/user (get binding 1) action))))

(defn event [e]
  (cam/handle-event (state :camera) e))

(defn update-doll []
  (if (> (input/state (actions :up)) 0) (print "up!!!")
      (if (> (input/state (actions :down)) 0) (print "down!!!")))
  (if (> (input/state (actions :left)) 0) (print "left!!!")
      (if (> (input/state (actions :right)) 0) (print "right!!!"))))

(defn update []
  (update-doll)
  (cam/update (state :camera))
  (dbg/draw/camera (state :camera))
  (dbg/draw/grid 0)
  (v3d/draw (state :camera)))

(defn shutdown [])

(defn voodoo []
  @{:width 960
    :height 540
    :init init
    :event event
    :update update
    :shutdown shutdown})

Roadmap

  • Memory management & Allocators
  • Asset pipeline
  • Build system ๐Ÿšง
  • Virtual file system
  • Asset management system
  • Fiber-based job system
  • Basic orbit camera
  • Debug drawing
  • Scripting
  • Visual scripting
  • Forward renderer ๐Ÿšง
  • ImGui
  • Entity component system ๐Ÿšง
  • Skeletal animation ๐Ÿšง
  • Animation controller
  • Audio
  • Physics
  • Networking
  • Web (WASM) support
  • Windows support
  • Linux support
  • MacOS support
  • Android support
  • iOS support

License

voodoo is licensed under the MIT License.

voodoo's People

Contributors

zacharycarter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.