All Projects → aframevr → A Painter

aframevr / A Painter

Licence: mit
🎨 Paint in VR in your browser.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to A Painter

Ideaspace
😎 Create interactive 3D and VR web experiences for desktop, mobile & VR devices
Stars: ✭ 344 (-36.18%)
Mutual labels:  aframe, threejs, vr, virtual-reality, webvr
Aframe Inspector
🔍 Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
Stars: ✭ 469 (-12.99%)
Mutual labels:  aframe, threejs, vr, virtual-reality, webvr
a-blast
💥 Save the World From the Cutest Creatures in the Universe!
Stars: ✭ 116 (-78.48%)
Mutual labels:  threejs, vr, webvr, aframe, virtual-reality
Awesome Aframe
[DISCONTINUED] Collection of awesome resources for the A-Frame WebVR framework.
Stars: ✭ 1,310 (+143.04%)
Mutual labels:  aframe, threejs, vr, virtual-reality, webvr
aframe-registry
[DISCONTINUED] Curated collection of community A-Frame components.
Stars: ✭ 76 (-85.9%)
Mutual labels:  threejs, vr, webvr, aframe, virtual-reality
Aframe
🅰️ web framework for building virtual reality experiences.
Stars: ✭ 13,428 (+2391.28%)
Mutual labels:  aframe, threejs, vr, virtual-reality, webvr
lvr
👓 Augmented Reality for everyone - Out of the world experiences
Stars: ✭ 92 (-82.93%)
Mutual labels:  threejs, vr, webvr, aframe, virtual-reality
Patches
Patches is a visual programming editor for building WebVR and WebGL experiences.
Stars: ✭ 164 (-69.57%)
Mutual labels:  threejs, vr, virtual-reality, webvr
Superframe
📦 A super collection of A-Frame components.
Stars: ✭ 1,061 (+96.85%)
Mutual labels:  aframe, vr, virtual-reality, webvr
3dio Js
JavaScript toolkit for interior apps
Stars: ✭ 255 (-52.69%)
Mutual labels:  aframe, threejs, vr, webvr
Aframe Vimeo Component
Stream Vimeo videos into WebVR.
Stars: ✭ 62 (-88.5%)
Mutual labels:  aframe, threejs, vr, webvr
A Mmd
A-Frame MMD component
Stars: ✭ 74 (-86.27%)
Mutual labels:  aframe, threejs, vr, webvr
Remixvr
RemixVR is a tool for collaboratively building customisable VR experiences.
Stars: ✭ 129 (-76.07%)
Mutual labels:  threejs, vr, virtual-reality, webvr
Worlds2
Building Virtual Reality Worlds using Three.js
Stars: ✭ 34 (-93.69%)
Mutual labels:  threejs, vr, virtual-reality, webvr
Aframe React
:atom: Build virtual reality experiences with A-Frame and React.
Stars: ✭ 1,199 (+122.45%)
Mutual labels:  aframe, vr, virtual-reality, webvr
Thehallaframe
WebVR demo that displays art
Stars: ✭ 120 (-77.74%)
Mutual labels:  aframe, threejs, vr, webvr
Aframe Effects
A VR Ready Post processing framework for Three.js and/or A-Frame
Stars: ✭ 176 (-67.35%)
Mutual labels:  aframe, threejs, vr, webvr
pacman
Pacman WebVR using Aframe
Stars: ✭ 20 (-96.29%)
Mutual labels:  vr, webvr, aframe
aframe-react
React library for A-frame
Stars: ✭ 58 (-89.24%)
Mutual labels:  vr, webvr, aframe
WebVRExamples
yonet.github.io/webvrexamples/examples/cubes.html
Stars: ✭ 19 (-96.47%)
Mutual labels:  vr, webvr, virtual-reality

A-Painter

Paint in VR in your browser. Read more!

A-Painter logo

VIEW GALLERY

Usage

Local Development

git clone [email protected]:aframevr/a-painter && cd a-painter
npm install
npm start

Then, load http://localhost:8080 in your browser.

URL parameters

  • url (url) Loads a painting in apa format
  • urljson (url) Loads a painting in json format
  • sky (image url) Changes the sky texture (empty to remove sky)
  • floor (image url) Changes the floor texture (empty to remove)
  • bgcolor (Hex color without the #) Background color

Example: http://aframe.io/a-painter/?sky=&floor=http://i.imgur.com/w9BylL0.jpg&bgcolor=24caff&url=https://ucarecdn.com/0b45b93b-e651-42d8-ba49-b2df907575f3/

Brush API

Brush Interface

To create a new brush, implement the following interface:

BrushInterface.prototype = {
  init: function () {},
  addPoint: function (position, orientation, pointerPosition, pressure, timestamp) {},
  tick: function (timeOffset, delta) {}
};
  • init (): Use this for initializing variables, materials, etc. for your brush.

  • addPoint (Mandatory): It will be called every time the brush should add a new point to the stroke. You should return true if you've added something to the scene and false otherwise. To add some mesh to the scene, every brush has an injected object3D attribute that can be used to add children to the scene.

    • position (vector3): Controller position.
    • orientation (quaternion): Controller orientation.
    • pointerPosition (vector3): Position of the pointer where the brush should start painting.
    • pressure (float[0..1]): Trigger pressure.
    • timestamp (int): Elapsed milliseconds since the starting of A-Painter.
  • tick (Optional): Is called on every frame.

    • timeOffset (int): Elapsed milliseconds since the starting of A-Painter.
    • delta (int): Delta time in milliseconds since the last frame.

Development Tip: set your brush as the default brush at the top of src/components/brush.js (brush: {default: 'yourbrush'}) while developing so you don't have to re-select it every time you reload.

Common Data

Every brush will have some common data injected with the following default values:

this.data = {
  points: [],
  size: brushSize,
  prevPosition: null,
  prevPointerPosition: null,
  numPoints: 0,
  maxPoints: 1000,
  color: color.clone()
};
  • points (Array of vector3): List of control points already painted in the current stroke with this brush. (It's updated on every call to addPoint.)
  • size (float): Brush size. (It's defined when the stroke is created.)
  • prevPosition (vector3): The latest controller position (from the last addPoint call).
  • prevPointerPosition (vector3): The latest pointer position (from the last addPoint call).
  • numPoints (int): Length of points array.
  • color (color): Base color to be used on the brush. (It's defined when the stroke is created.)

Registering a New Brush

To register a new brush we should call AFRAME.registerBrush:

AFRAME.registerBrush(brushName, brushDefinition, options);

Register brush needs three parameters:

  • brushName (string): The unique brush name.
  • brushDefinition (object): The custom implementation of the previously defined brushDefinition.
  • options (object [Optional]):
    • thumbnail (string): Path to the thumbnail image file.
    • spacing (float): Minimum distance, in meters, from the previous point needed to call addPoint.
    • maxPoints (integer): If defined, addPoint won't be called after reaching that number of points.

File Format

A-Painter uses the following custom binary file format to store the drawings and its strokes.

string magic ('apainter')
uint16 version (currently 1)
uint8 num_brushes_used
[num_brushed_used] x {
  string brush_name
}
uint32 num_strokes
[num_strokes] x {
  uint8 brush_index (Based on the previous definition order)
  float32x3 color (rgb)
  float32 size
  uint32 num_points
  [num_points] x {
    float32x3 position (vector3)
    float32x4 orientation (quaternion)
    float32 intensity
    uint32 timestamp
  }
}

string = uint8 (size) + size * uint8
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].