kpiorno / kivy3dgui

Pure Kivy library to display and interact with Kivy widgets in a 3D mesh.
MIT License
127 stars 29 forks source link

Objects not showing correctly #14

Closed manicolan closed 2 years ago

manicolan commented 3 years ago

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

kpiorno commented 3 years ago

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

kpiorno commented 3 years ago

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
manicolan commented 3 years ago

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