Has anyone thought about having a text representation of a scene that gets converted into threejs code or previewed in a live threejs scene canvas?
Similar to how markdown can be used as a simplified text representation of common HTML patterns.
Any suggestions for a text file format? I was thinking something YAML like. Object3Ds can be nested and properties can be set for each instance. Here’s an idea for a grammar
Scene MyScene
+ PerspectiveCamera (camera1)
- fov: 75
- aspect: 1
- near: 0.1
- far: 1000
- position: 0 0 5
# Geometry Box (box1)
# Material Basis (red)
- color: #ff0000
- Children
+ Mesh box1 red
- position: 1 0 0
> onPointerDown(event) {
console.log('Pointer down event:', event);
}
# defines an object such as a material or geometry so that it can be referenced multiple times later
+ adds supported object types
- set properties of the parent object
> adds event listeners to parent object
document and windows would be pre-existing objects for adding event listeners.
Still got a lot to work out, but wanted the throw the idea out there.