kpiorno/kivy3dgui

Objects not showing correctly

manicolan opened this issue · 3 comments

Any idea why this happens for some objects?
Kivy vesion: 2.0.0rc4
Objects here

from kivy.app import App
from kivy.lang import Builder

class ExampleApp(App):

    def build(self):
        root = Builder.load_string('''

#: import Layout3D kivy3dgui.layout3d
Layout3D:
    id: par
    size_hint: (1.0, 1.0)
    Node:
        id: Node1
        name: 'Node 0'
        rotate: (270, 90, 0, 0)
        # scale: (0.2, 0.2, 0.2)
        translate: (0, -10, -50)
        meshes: ("./untitled.obj", )
        FloatLayout:
            canvas:
                Color:
                    rgb: 1, 1, 1, 1
                Rectangle:
                    size: self.size
                    pos: self.pos
        ''')
        self.root = root
        return root


if __name__ == '__main__':
    ExampleApp().run()

Untitled

Hi, @manicolan did you test it in a previous Kivy version?

Ok, I found the issue. The obj file has to be exported with triangulated faces. I opened it with Blender and I exported it with that option.
Converted object
Captura de Pantalla 2020-12-08 a la(s) 18 56 57

@kpiorno Yeah that works! I think it would be better if you mention this somewhere in the readme file. Thanks a lot!