On Dec 28, 2012 11:09 AM, "Evan Czaplicki" <eva...@gmail.com> wrote:
>
> The more I think about this, the more I feel like it'd be nice to hook it up to a higher-level physics engine or rendering engine. One of my work mates is working on a JS physics engine, so I'll talk to him about how all of these things work. It sounds like they may end up with somewhat declarative interfaces, making it a nice choice for Elm.
Is he doing that for your employer? I have a. Bunch of experience with the box2d physics engine and I think it would be relatively easy to wrap. Because physics engines are so. Self contained. You can just configure them and they're off.
> Really, honestly, for real, the easiest mistake to make is to just start coding.
Which is why we're talking here right?
> One thing that could help is using records (coming next release) to hide a bunch of default settings. This would allow the defaults to be out of mind for most cases, but also allows advanced users to update the records if necessary.
Yes I think that is a good idea but configuration is not the big problem here, you can hide complexity with helper functions too.
I expect basic 3D bindings would work much like John says, where you have a purely functional data structure that you turn into procedural calls.
Yes this is what I am trying to do but the problem lies with the typing of this graph in relation to the shaders. I couldn't make sense from Johns mail at all but it was send from his phone so maybe he can shine some light on this later.
>>> On Dec 27, 2012, at 1:18 PM, Dobes Vandermeer <dob...@gmail.com> wrote:
>>
>>>
>>>> What I understand, however, is that the accelerated 3d programming often requires things to be done in a certain order. In this case, you can't just return a scene graph, you have to return a list of instructions to execute.
You are right. I used the term scene graph, but what I was trying to make clear is that this graph is actually an instruction tree. So the scene graph is the instruction list you are describing here.
>>> You could return a list of WebGL functions to call and their arguments, but that wouldn't be as nice to use as collage is. So, perhaps a slightly higher level system like a mix of commands to change GL settings / modes and collage style scene graph objects to render.
Sort of, but the gl commands are mostly used to interact with the shader program. I am looking for a way to do this in a statically typed way. Perhaps the only way is to have the shaders themselves be written in an embedded Elm subset.
>>>
>>> It definitely seems a bit more tricky ... I'd probably start with something wrapping three.js if I were you, then move to a lower level once you have a good handle on how that API looks.
>>>
Thanks for the feedback so far guys.