All Projects → little-core-labs → Axis3d

little-core-labs / Axis3d

Licence: mit
Functional 3d graphics library

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Axis3d

Vue Babylonjs
A ready-to-go 3d environment for Vue.js using Babylon.js
Stars: ✭ 356 (+431.34%)
Mutual labels:  graphics, vr
Icg Webgl
交互式计算机图形学——基于WebGL的自顶向下方法(第七版)的例子与练习题
Stars: ✭ 458 (+583.58%)
Mutual labels:  graphics, webgl
Beam
✨ Expressive WebGL
Stars: ✭ 383 (+471.64%)
Mutual labels:  graphics, webgl
Cga.js
CGA 3D 计算几何算法库 | 3D Compute Geometry Algorithm Library webgl three.js babylon.js等任何库都可以使用
Stars: ✭ 313 (+367.16%)
Mutual labels:  graphics, webgl
Worlds2
Building Virtual Reality Worlds using Three.js
Stars: ✭ 34 (-49.25%)
Mutual labels:  webgl, vr
Magnum
Lightweight and modular C++11 graphics middleware for games and data visualization
Stars: ✭ 3,728 (+5464.18%)
Mutual labels:  graphics, webgl
Lume
Create CSS3D/WebGL applications declaratively with HTML. Give regular DOM elements shadow and lighting.
Stars: ✭ 445 (+564.18%)
Mutual labels:  graphics, webgl
hypVR-Ray
Hyperbolic VR using Raymarching
Stars: ✭ 81 (+20.9%)
Mutual labels:  webgl, vr
Xeogl
A WebGL-based 3D engine for technical visualization. Not actively maintained.
Stars: ✭ 920 (+1273.13%)
Mutual labels:  graphics, webgl
Gltfpp
glTF 2.0 loader for C++14
Stars: ✭ 22 (-67.16%)
Mutual labels:  graphics, webgl
Enterprisepbrshadingmodel
Stars: ✭ 299 (+346.27%)
Mutual labels:  graphics, vr
Aframe Vimeo Component
Stream Vimeo videos into WebVR.
Stars: ✭ 62 (-7.46%)
Mutual labels:  webgl, vr
Ofelia
A real-time cross-platform creative coding tool for multimedia development
Stars: ✭ 269 (+301.49%)
Mutual labels:  graphics, webgl
Vue Vr
A framework for building VR applications with Vue
Stars: ✭ 348 (+419.4%)
Mutual labels:  webgl, vr
3dio Js
JavaScript toolkit for interior apps
Stars: ✭ 255 (+280.6%)
Mutual labels:  webgl, vr
Vue Gl
Vue.js components rendering 3D WebGL graphics reactively with three.js
Stars: ✭ 434 (+547.76%)
Mutual labels:  graphics, webgl
Raindrop Fx
An optimised raindrop effect on glass with WebGL2
Stars: ✭ 218 (+225.37%)
Mutual labels:  graphics, webgl
Polymer
🎨 graphics + interaction engine
Stars: ✭ 243 (+262.69%)
Mutual labels:  graphics, vr
React Force Graph
React component for 2D, 3D, VR and AR force directed graphs
Stars: ✭ 589 (+779.1%)
Mutual labels:  webgl, vr
Xna.js
WebGL framework strongly inspired by the XNA library
Stars: ✭ 40 (-40.3%)
Mutual labels:  graphics, webgl

Axis3D

Axis3D is a lightweight functional graphics library built on top of regl. It aims to be compatible with many components within the stack.gl ecosystem. It provides a set of components with sane defaults. It is not intended to replace existing libraries, but instead provide an alternative way for rendering graphics.

This library is heavily inspired by the underlying mechanics of regl and the functional/reactive component patterns introduced in react. The scene graph and transform state is implied by the declarative structure of the components.

Everything is a function that injects a regl context. Vectors and matrices are plain arrays that are compatible with gl-matrix and the like. Axis3D should feel familiar to three.js, but with less features.

Status

Stable - This project is in active development towards 1.0.0

Installation

$ npm install axis3d

Features

Example

import { Geometry, Material, Context, Frame, Mesh } from 'axis3d'
import { PerspectiveCamera } from 'axis3d/camera'
import Bunny from 'bunny'
import quat from 'gl-quat'

// scale vertices along the `y-axis` down a bit
for (const p of Bunny.positions) { p[1] = p[1] - 4 }

const ctx = new Context()
const rotation = quat.identity([])
const material = new Material(ctx)
const camera = new PerspectiveCamera(ctx)
const frame = new Frame(ctx)
const bunny = new Mesh(ctx, {geometry: new Geometry({complex: Bunny})})

// requestAnimationFrame loop helper with context injection
frame(scene)

// the scene drawn every frame
function scene({time}) {
  quat.setAxisAngle(angle, [0, 1, 0], 0.5*time)
  camera({rotation, position: [0, 0, 5]}() => {
    material(() => {
      bunny()
    })
  })
}

Comparisons

The following are comparisons for effectively doing the same thing in Axis3D below.

Axis3D

import { PerspectiveCamera, Context, Material, Frame, Mesh, } from 'axis3d'
import { BoxGeometry } from 'axis3d-geometry'
import quat from 'gl-quat'

const ctx = new Context()

const rotation = quat.identity([])
const geometry = new BoxGeometry({x: 10, y: 10, z: 10})
const material = new Material(ctx)
const camera = new PerspectiveCamera(ctx, {fov: 60, near: 0.1, far: 1000})
const frame = new Frame(ctx)
const mesh = new Mesh(ctx, {geometry})

frame(({time}) => {
  quat.setAxisAngle(rotation, [0, 1, 0], 0.5*time)
  camera({position: [0, 0, 5]}, () => {
    material({color: [0, 0, 1]}, () => {
      mesh({rotation})
    })
  })
})

THREE

const aspect = window.innerWidth/window.innerHeight
const near = 0.1
const far = 1000
const fov = 60

const renderer = new THREE.WebGLRenderer()
const geometry = new THREE.BoxGeometry(10, 10, 10)
const material = new THREE.MeshBasicMaterial({color: 0x0000ff, wireframe: true})
const camera = new THREE.PerspectiveCamera(fov, aspect, near, faar)
const scene = new THREE.Scene()
const mesh = new THREE.Mesh(geometry, material)

camera.position.z = 5
renderer.setSize(window.innerWidth, window.innerHeight)
scene.add(mesh)
document.body.appendChild(renderer.domElement)

frame()
function frame() {
  requestAnimationFrame(frame)
  mesh.rotation.y = 0.5*Date.now()
  renderer.render(scene, camera)
}

Contributors

See Also

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].