firtoz / react-three-renderer

Render into a three.js canvas using React.
https://toxicfork.github.com/react-three-renderer-example/
MIT License
1.49k stars 155 forks source link

Translating OpenGL objects to React-three-renderer #160

Open p-fernandez opened 7 years ago

p-fernandez commented 7 years ago

I am trying to import OpenGL 3D models into React Three Renderer to make a simple app that is able to do slight modifications on said models.

A typical OpenGL structure XML file for mesh would be like this:

<surfaces>
    <quad>
        <mesh width="1" height="1">-1,-1,0.125,0,1,-1,0.875,0,-1,1,0.125,1,1,1,0.875,1</mesh>
    </quad>
    <quad>
        <mesh width="1" height="1">-1,-1,-3.72529e-09,0,1,-1,1,0,-1,1,-3.72529e-09,1,1,1,1,1</mesh>
    </quad>
    <quad>
        <mesh width="1" height="1">-1,-1,-3.72529e-09,0,1,-1,1,0,-1,1,-3.72529e-09,1,1,1,1,1</mesh>
    </quad>
</surfaces>

Is there any react-three-renderer component that can be instantiated from a 4x4 matrix like the one provided by the OpenGL mesh? Or should I need to create manually all the vertices from said matrix? Thank you!

toxicFork commented 7 years ago

Can you please provide a link to the XML spec? Currently I am not sure if such a loader exists.

57 seems to be related as well.

I'll continue adding notes when I get an opportunity to look deeper :)

p-fernandez commented 7 years ago

As far as I know it is version 0.4, but I am unable to find a specification document. I might be able to ask for it to the software developers that generate those xml files of the OpenGL models.

Thank you for the linked issue, though I don't find it completely helpful for my goal.