Live data from Hacker News

Show HN: Primrose – a text editor that runs in a WebGL texture

primroseeditor.com

61–70 of 105 posts

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#61

Earlier quoted context omitted.

Holy crap, great idea! Imagine if adding a "monitor" (virtually speaking, of course) to your setup was no more difficult than splitting a Vim window... that would be pretty rad. An Oculus Rift is much less expensive than your typical multi-monitor setup too, FWIW.

Finally, a virtual reality so immersive it can simulate a room full of teletypes.

"A mouse is a device used to point at the xterm you want to type in."

A VR headset is a device used to look at the xterm you want to type in.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#62

Earlier quoted context omitted.

Actually, that's where this project came from. Several months ago, we had had a conversation about the difficulties of integrating text input in WebVR. https://github.com/brianpeiris/RiftSketch/issues/13 After New Years, I got the bug in me to work on this and just knuckled down on it. Though, Brian appears to be happy with where he is, now.

Author of CodeChisel3D here: I integrated the ace editor for the purpose of being used in webVR environments: http://kra.hn/projects/live-programming-with-three-and-webvr

I'm sorry I didn't know about your project a month ago. I'd be very curios to hear how you render the text. Are you still using Ace for the rendering, or is it just for the editing and tokenizing?

In my very first proof-of-concept, I used hidden DOM elements to do the layout and styling of the text, and then queried the element properties to figure out the draw operations I needed to do. It was very slow and really unreliable, though, and I had a lot of cross-browser issues. Ultimately, redoing everything from scratch was actually easier than trying to hack around DOM.

I've been seriously considering implementing a soft keyboard for mobile devices as well. It's just so hard to get the ones in the wild to interact with text in any common way, and on iOS it's nearly impossible to get everything resized correctly to use the most of the screen real estate.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#63

This is really cool, and it's the direction my project (with a large scope) will eventually go in. I already have a text editing component and highlighting working using OpenGL, but it needs updating to not use immediate mode so it can run in WebGL too.

Would love to hear more about your project.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#65

Seems to not work in FF?

Hi, sorry I missed you earlier. Would you be able to provide more details as to the nature of your difficulties? Does the JavaScript console show any errors? What are your browser version and OS? Thanks.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#66

Earlier quoted context omitted.

Holy crap, great idea! Imagine if adding a "monitor" (virtually speaking, of course) to your setup was no more difficult than splitting a Vim window... that would be pretty rad. An Oculus Rift is much less expensive than your typical multi-monitor setup too, FWIW.

Actually, I'm hoping to be able to experiment with code layout ideas that do not strictly adhere to a window. 2D elements tend to not map well to 3D spaces. One of the problems with the text-in-a-texture method that I've done here is that there is no relief of depth to the text, and relief is actually an important part of how we make sense out of objects in 3D space. It's fine on a 2D screen because the context is so…

> Like, why do we still use plain text in flat files for source code

Information density. Images and graphs are exceptions to the general rule that text can contain a lot more information on one page than graphics can.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#67

So here's why this is particularly awesome in my head. I am a digital nomad, and basically travel with a backpack's worth of stuff, developing off my 13"MBA. The thing I miss the most about my old office is having a nice monitor. The thing I miss most about having a home is my 3-monitor desktop setup. Both things I had to give up because they don't fit in my backpack and because I can't easily procure them wherever I…

What stops you from having multiple windows on your desktop? Oculus sucks at displaying text - it's low resolution (half of 1080p), it has crazy chromatic abberations, and you have to transform "spherize" your image to correct for the lens distortion, further reducting the resolution. Oculus is not light - it's pretty annoying to wear it for longer than 20-30 minutes.

I think the version based on the Note 4 is 2560x1440 so that's already quite a big leap up. Give it two years and we might have usable text editing maybe?

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#68
post #44

Just a warning, if you try this while using Safari it might crash and close all of your tabs somehow. And it might make it so that you can't reopen those tabs despite the fact that you have tabs set to be restored each session. And you may in fact experience the acute pain of losing a year's worth of painstakingly accumulated tabs. Not that this has happened to me.

I'm really sorry about that. I didn't know it was going to do that. I had seen that it was doing that in browsers on Android and specifically disabled it for mobile users to avoid such an awful experience. I had just assumed that Safari, being WebKit, would work just as well as the least common denominator of Chrome and Opera. Again, very sorry. I guess that will teach me to start sneaking into my wife's computer bag…

No apologies are needed, nothing critical was lost :). Cool project BTW.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#69

Earlier quoted context omitted.

Author of CodeChisel3D here: I integrated the ace editor for the purpose of being used in webVR environments: http://kra.hn/projects/live-programming-with-three-and-webvr

I'm sorry I didn't know about your project a month ago. I'd be very curios to hear how you render the text. Are you still using Ace for the rendering, or is it just for the editing and tokenizing? In my very first proof-of-concept, I used hidden DOM elements to do the layout and styling of the text, and then queried the element properties to figure out the draw operations I needed to do. It was very slow and really u…

The motivation behind CodeChisel3D is to reuse everything that ace provides, text modes, syntax highlighting, completion and so on. So, yes, my approach is to create a hidden ace editor in the DOM and then hook into the rendering mechanism of ace to render it to a texture that can be mapped into webGl and threejs scenes. The main reason for that is to support live webVR coding. I'm currently working on another project but I will get back to CodeChisel3D and improve it. You seem to have come quite far with primrose and might not be interested but the actual editor integration is here: https://github.com/rksm/three-codeeditor. Feel free to use it.

Re: Show HN: Primrose – a text editor that runs in a WebGL texture

#70
post #48

Earlier quoted context omitted.

Because I cycle through a lot of tabs. Yes, some of them I leave up for months to pick away at, but others I finish in just a day. It's much easier to close tabs than to edit my bookmarks constantly. And losing those tabs isn't an issue because Safari can be made to reopen those tabs each session, even after unexpected shutdown or whatever. But then this happened. I need to write something that will back up my tabs.

I'm the same way, so I can relate to your pain. I've had this happen before with Chrome/Chromium with hundreds of tabs. I now use Firefox for two reasons: One, the UI is better than Chrome/Chromium with hundreds of tabs active, and two I now simply periodically clear out long term tabs when I no longer have an immediate need for them by bookmarking them. My friends think I'm insane by keeping so many tabs open. Maybe…

Wow, you really get it. You really hit the nail of the head about bookmarks. They are almost always completely forgotten. Tabs, however, are constantly groomed and sifted through and pruned. If I could have my way, I would take Safari with all it's nice features like sexy tab scrolling and tab view (these are major assets to the tab junkie) and reshape it into something entirely tab based. Instead of bookmarks, you would have long lived tabs. And all the tabs are categorized in whatever way the user wants. And tab view would actually allow you to manipulate tabs while viewing them (it is a fucking mystery to me why you can't do that). So it would be like having all your bookmarks and tabs mixed into one pot. And of course, bullet proof tab recovery features without the cloud. Jesus, maybe I should just write a Safari extension.
Post reply on HN