voxel / ideas

issue tracker for new voxel.js plugin ideas
4 stars 1 forks source link

In-world text editor #40

Open deathcap opened 9 years ago

deathcap commented 9 years ago

A text editor that runs within a voxel.js world

This was sort of possible with voxel-webview, embedding an ordinary HTML textarea, but this is better — a text editor built to render to the WebGL canvas:

https://www.primroseeditor.com/

https://github.com/capnmidnight/Primrose

for several reasons (especially for voxel-vr):

Much more importantly, in the WegGL context, the HTML Element will not be a part the scene and will not work with any depth buffering. Your text will always be a 2D element masquerading in a 3D world, never overlapping properly with other objects in the scene. You will have to duplicate all of your world and camera transformations from the WebGL context to CSS3 3D transforms[4]. And any form of stereo rendering will require you to keep a secondary HTML element in sync with the edits made in the primary element.

potential use cases include #27 signs, books, and in-world software development (even better with https://github.com/deathcap/voxel-plugins/issues/1)

Also intriguing, as an oldschool Unix hacker I like this better:

https://github.com/coolwanglu/vim.js Vim.js : JavaScript port of Vim

renders to an HTML5 canvas (2d context) — can it be reworked to render to a WebGL texture for 3d?

capnmidnight commented 9 years ago

Hi there. If you need any help, let me know.