Giter VIP home page Giter VIP logo

draw3d.jl's Introduction

Draw3D

Note - NOT STABLE, NOT USABLE

This is pre-alpha and nothing about it is stable, or sometimes even functioning.

Draw3D is a package for 3D graphics with a nice Julian API.

It is built on top of the OpenGL.jl and GLFW.jl packages and takes advantage of the fantastic work they have done wrapping the OpenGL API. Those packages provide an API that is a direct mapping of the OpenGL C API however, which isn't particularly user-friendly if you are not already an OpenGL developer.

The main datatypes are Mesh, Light, Material, Transform

Examples

The simplest possible thing is to render a unit (1x1x1) cube in the default position, which is with its local origin at the global origin.

c = Cube()
display(c)

To make a cube that is twice as large and centered at the origin:

c = Cube()
c = scale(c, 2)
c = translate(c, -1, -1, -1)
display(c)

As you can see this can get a little verbose. All the transform functions are also defined for partial application, so you can also use Julia's built-in composition operator like so:

Cube() |> scale(2) |> translate(-1, -1, -1) |> display

Limitations

Transparent Materials

Transparent objects are assumed to be convex, and are rendered by first rendering the faces pointing away from the camera and then those pointing towards. Handling this properly for non-convex meshes requires z-sorting the faces, which we don't do right now.

Dependencies

  • GLFW.jl
  • OpenGL.jl
  • libglfw2

draw3d.jl's People

Contributors

ssfrr avatar

Stargazers

Steve Kelly avatar Ethan Sherbondy avatar

Watchers

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