├── LICENSE ├── README.md ├── checker.py ├── data ├── imgs │ ├── background.jpg │ ├── board.png │ ├── checkerb.png │ ├── drawer.png │ ├── egyptrockyfull.jpg │ ├── faust_github.jpg │ ├── green.png │ ├── imgback.jpg │ ├── modern2.png │ ├── red.png │ ├── table.png │ ├── terr_rock6.jpg │ └── worldtex.png └── obj │ ├── 2dbox.mtl │ ├── 2dbox.obj │ ├── 2dbox.obj.png │ ├── athene.mtl │ ├── athene.obj │ ├── athene.obj.png │ ├── bendbox.mtl │ ├── bendbox.obj │ ├── box.mtl │ ├── box.obj │ ├── box_sphere.mtl │ ├── box_sphere.obj │ ├── box_sphere.obj.png │ ├── cbox.mtl │ ├── cbox.obj │ ├── drawer.obj │ ├── objs.mtl │ ├── objs.obj │ ├── objs.obj.png │ ├── sphere.mtl │ ├── sphere.obj │ ├── spherelow.mtl │ ├── spherelow.obj │ ├── table.obj │ ├── tank.mtl │ ├── tank.obj.png │ ├── tank.obj.png.jpg │ ├── untitled3.mtl │ ├── untitled3.obj │ ├── untitled3.obj.png │ └── untitled3x.obj.png ├── editor ├── editor_manager.py ├── images │ ├── blue.png │ ├── green.png │ ├── normal.png │ └── red.png ├── meshes │ ├── x-axis.obj │ ├── x-rot-axis.obj │ ├── x-scale-axis.obj │ ├── y-axis.obj │ ├── y-rot-axis.obj │ ├── y-scale-axis.obj │ ├── z-axis.obj │ ├── z-rot-axis.obj │ └── z-scale-axis.obj ├── node_helper.py └── space_editor.py ├── editor3d.py ├── example.py ├── example2.py ├── kivy3dgui ├── __init__.py ├── canvas3d.py ├── effectwidget.py ├── fbowidget.py ├── gles2.0 │ ├── shaders │ │ ├── dop.glsl │ │ ├── invert.glsl │ │ ├── legacy.glsl │ │ ├── motionblur.glsl │ │ ├── selection.glsl │ │ ├── shadowpass.glsl │ │ └── simple_no_light.glsl │ └── toonshader │ │ ├── toon.glsl │ │ ├── toon_shadows.glsl │ │ └── toon_shadows_prev.glsl ├── layout3d.py ├── node.py └── objloader.py ├── meshes ├── 2dbox.obj ├── box.mtl ├── box.obj └── sphere.obj ├── screenshots ├── 3DEditor.gif ├── screenshot1.jpg └── screenshot2.jpg └── tour3d.py /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2018 Karel Piorno Charchabal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kivy3dgui 2 | 3 | Kivy 3D. A pure Kivy library to display and interact with Kivy widgets in a 3D mesh. 4 | 5 | If you want to help with the development you can mail me: kpiorno@gmail.com 6 | 7 | It's easy to test, just download the code a run the examples. Enjoy it!!! 8 | 9 | You can watch a video example [here](https://www.youtube.com/watch?v=V3lhi2OGz0U). 10 | Another [video](https://www.youtube.com/watch?v=rpZFwcV-H0A) for Tour3D Example. 11 | ### Work in progress 12 | The 3D Editor is in the early stage. Baby steps, many issues :) anyway, you can test it at ```editor_3d``` branch. 13 | 14 | ![](https://github.com/kpiorno/kivy3dgui/blob/master/screenshots/3DEditor.gif) 15 | 16 | ### How to use 17 | #### Step 1 18 | 19 | Start by importing the Layout3D. This layout manages 3D Nodes but behaves just 20 | like a normal Kivy FloatLayout. 21 | 22 | ```python 23 | #:kivy 1.0 24 | #: import Layout3D kivy3dgui.layout3d 25 | ``` 26 | #### Step 2 27 | 28 | Create a Layout3D, which you can also do from Python. 29 | 30 | ```python 31 | Layout3D: 32 | id: par #id for Layout3D, could be referenced just like any Kivy Widget 33 | size_hint: (1.0, 1.0) 34 | canvas_size: (1366, 768) # Canvas resolution 35 | post_processing: False # Post-processing effects (bloom, hdr,...) 36 | ``` 37 | 38 | You can change the position of the camera using the 'lookat' property, 39 | which sets the [gluLookAt transformation](https://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml). 40 | It defaults to (0, 0, 10, 0, 0, 0, 0, 1, 0). 41 | 42 | 43 | #### Step 3 44 | Create nodes and add them to the Layout3D. Nodes are used to apply 3D 45 | effects, transformations and display 3D meshes in Kivy layouts. 46 | 47 | Nodes may be a set of 3D meshes (obj format is only supported at now). Be sure 48 | to set the UV mapping correctly. If you add a FloatLayout to the node it will be 49 | used as a texture for the meshes and you will be able to interact with 50 | the widgets that are seen on the surface of the meshes, no matter the shape: 51 | touch events are accurately translated to preserve behavior. 52 | 53 | The possibilities are endless. Just use your imagination. 54 | 55 | ```python 56 | Node: 57 | id: Node1 58 | name: 'Node 0' 59 | rotate: (90, 0.3, 1, 0) # Angle and x, y, z axis of the rotation matrix 60 | scale: (0.4, 0.4, 0.4) # x, y, z of scaling matrix 61 | translate: (20, -10.0, -110) # x, y, z of translation matrix 62 | effect: True 63 | meshes: ("./data/obj/sphere.obj", ) #List of meshes (obj only) 64 | ``` 65 | For more detail on these parameters and matrices, please see the 66 | [glRotate matrix](https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml), 67 | [glScale matrix](https://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml) 68 | and [glTranslate](https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml) 69 | documentation. 70 | 71 | #### Step 4 72 | Create interaction widgets. 73 | The root widgets for Nodes must be a Layout3D. All its children will use this as 74 | the texture for the set of meshes. As mentioned, you will be able to interact 75 | with the widgets. 76 | 77 | ```python 78 | FloatLayout: 79 | canvas: 80 | Color: 81 | rgb: 1, 1, 1,0.1 82 | Rectangle: 83 | size: self.size 84 | pos: self.pos 85 | source: "./data/imgs/background.jpg" 86 | size_hint: (1.0, 1.0) 87 | Button: 88 | pos_hint: {"x":0, "y":0 } 89 | size_hint: (None, None) 90 | text: "Hello" 91 | 92 | ``` 93 | ![Screenshot](https://github.com/kpiorno/kivy3dgui/blob/master/screenshots/screenshot1.jpg "Screenshot") 94 | -------------------------------------------------------------------------------- /checker.py: -------------------------------------------------------------------------------- 1 | from kivy.app import App 2 | from kivy.uix.button import Button 3 | from kivy.uix.floatlayout import FloatLayout 4 | from kivy.animation import Animation 5 | from kivy3dgui.layout3d import Node 6 | 7 | class CheckerApp(App): 8 | def build(self): 9 | from kivy.lang import Builder 10 | self.delay = 8.0 11 | self.red_n = [] 12 | self.green_n = [] 13 | layout3d = Builder.load_string(''' 14 | #:kivy 1.0 15 | #: import Layout3D kivy3dgui.layout3d 16 | #: import Animation kivy.animation.Animation 17 | Layout3D: 18 | id: par 19 | size_hint: (1.0, 1.0) 20 | canvas_size: (1366, 768) 21 | post_processing: False 22 | canvas.before: 23 | Color: 24 | rgb: 1, 1, 1,0.1 25 | Rectangle: 26 | size: self.size 27 | pos: self.pos 28 | source: "./data/imgs/checkerb.png" 29 | Button: 30 | size_hint: (0.15, 0.1) 31 | pos_hint: {"x":0.0, "y":0.9} 32 | text: "perspective" 33 | on_press: 34 | app.perspective() 35 | 36 | Button: 37 | size_hint: (0.15, 0.1) 38 | pos_hint: {"x":0.16, "y":0.9} 39 | text: "front" 40 | on_press: 41 | app.frontal() 42 | 43 | ''') 44 | board = Builder.load_string(''' 45 | Node: 46 | rotate: (-90.0, 1.0, 0.0, 0) 47 | scale: (0.4, 0.5, 0.4) 48 | translate: (-5, -25, -70) 49 | effect: True 50 | meshes: ("./data/obj/2dbox.obj", ) 51 | 52 | FloatLayout: 53 | id: Board 54 | canvas: 55 | Color: 56 | rgb: 1, 1, 1,0.1 57 | Rectangle: 58 | size: self.size 59 | pos: self.pos 60 | source: "./data/imgs/board.png" 61 | size_hint: (1.0, 1.0) 62 | ''') 63 | green = ''' 64 | Node: 65 | rotate: (-90.0, 1.0, 0, 0) 66 | scale: (0.2,0.2,0.01) 67 | #translate: (-5, 0, -70) 68 | translate: (-5, -25, -70) 69 | effect: False 70 | picking: False 71 | meshes: ("./data/obj/spherelow.obj", ) 72 | FloatLayout: 73 | size_hint: (1.0, 1.0) 74 | Button: 75 | background_normal: "./data/imgs/green.png" 76 | ''' 77 | red = ''' 78 | Node: 79 | rotate: (-90.0, 1.0, 0, 0) 80 | scale: (0.2,0.2,0.01) 81 | #translate: (-5, 0, -70) 82 | translate: (-5, 95, -70) 83 | picking: False 84 | effect: True 85 | meshes: ("./data/obj/spherelow.obj", ) 86 | FloatLayout: 87 | size_hint: (1.0, 1.0) 88 | Button: 89 | background_normal: "./data/imgs/red.png" 90 | 91 | ''' 92 | self.board = board 93 | layout3d.add_widget(board) 94 | container = board.fbo_widget 95 | for x,y in [[x,y] for x in range(8) 96 | for y in range(8) if not(x+y)%2]: 97 | 98 | cell = Button(pos_hint={"x":x*0.125, "y":y*0.125}, 99 | size_hint=(0.125, 0.125)) 100 | if y < 3: 101 | figure = Builder.load_string(red) 102 | self.red_n.append({"node":figure, "front":(-31.5+x*7.8, -28+y*7.35, -108), 103 | "persp":(-31.5+x*7.8, -24, -95+y*7.35)}) 104 | layout3d.add_widget(figure) 105 | if y > 4: 106 | figure = Builder.load_string(green) 107 | self.green_n.append({"node":figure, "front":(-31.5+x*7.8, -28+y*7.35, -108), 108 | "persp":(-31.5+x*7.8, -24, -169+y*7.35)}) 109 | layout3d.add_widget(figure) 110 | 111 | container.add_widget(cell) 112 | self.frontal() 113 | return layout3d 114 | 115 | def frontal(self): 116 | Animation(rotate=(0.0, 1.0, 0.0, 0.0), translate=(-5, 0, -110), duration=1.0).start(self.board) 117 | for i, n in enumerate(self.red_n): 118 | (Animation(translate=(-30,20,-40), duration=(i+1)/(self.delay*1.0)) + 119 | Animation(translate=n["front"], rotate=(0,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"]) 120 | for i, n in enumerate(self.green_n): 121 | (Animation(translate=(30,-20,-40), duration=(i+1)/(self.delay*1.0)) + 122 | Animation(translate=n["front"], rotate=(0,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"]) 123 | 124 | 125 | def perspective(self): 126 | Animation(rotate=(-90.0, 1.0, 0.0, 0.0), translate=(-5, -25, -110),duration=1.0).start(self.board) 127 | for i, n in enumerate(self.red_n): 128 | (Animation(translate=(-30,20,-90), duration=(i+1)/(self.delay*1.0)) + 129 | Animation(translate=n["persp"], rotate=(-90,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"]) 130 | for i, n in enumerate(self.green_n): 131 | (Animation(translate=(30,-20,-90), duration=(i+1)/(self.delay*1.0)) + 132 | Animation(translate=n["persp"], rotate=(-90,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"]) 133 | 134 | 135 | if __name__ == '__main__': 136 | CheckerApp().run() 137 | -------------------------------------------------------------------------------- /data/imgs/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/background.jpg -------------------------------------------------------------------------------- /data/imgs/board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/board.png -------------------------------------------------------------------------------- /data/imgs/checkerb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/checkerb.png -------------------------------------------------------------------------------- /data/imgs/drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/drawer.png -------------------------------------------------------------------------------- /data/imgs/egyptrockyfull.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/egyptrockyfull.jpg -------------------------------------------------------------------------------- /data/imgs/faust_github.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/faust_github.jpg -------------------------------------------------------------------------------- /data/imgs/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/green.png -------------------------------------------------------------------------------- /data/imgs/imgback.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/imgback.jpg -------------------------------------------------------------------------------- /data/imgs/modern2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/modern2.png -------------------------------------------------------------------------------- /data/imgs/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/red.png -------------------------------------------------------------------------------- /data/imgs/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/table.png -------------------------------------------------------------------------------- /data/imgs/terr_rock6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/terr_rock6.jpg -------------------------------------------------------------------------------- /data/imgs/worldtex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/imgs/worldtex.png -------------------------------------------------------------------------------- /data/obj/2dbox.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 06.12.2014 10:23:07 3 | 4 | newmtl 01___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5882 0.5882 0.5882 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka C:\Users\kpiorno\Documents\3dsMax\sceneassets\images\Sphere01ShadowsMap.tga 16 | map_Kd C:\Users\kpiorno\Documents\3dsMax\sceneassets\images\Sphere01ShadowsMap.tga 17 | -------------------------------------------------------------------------------- /data/obj/2dbox.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 06.12.2014 10:23:07 3 | 4 | mtllib 2dbox.mtl 5 | 6 | # 7 | # object Box01 8 | # 9 | o 2DBox 10 | v -78.2906 -60.3419 -0.0000 11 | v -78.2906 59.6581 0.0000 12 | v 81.7094 59.6581 0.0000 13 | v 81.7094 -60.3419 -0.0000 14 | v -78.2906 -60.3419 1.0000 15 | v 81.7094 -60.3419 1.0000 16 | v 81.7094 59.6581 1.0000 17 | v -78.2906 59.6581 1.0000 18 | # 8 vertices 19 | 20 | vn 0.0000 0.0000 -1.0000 21 | vn 0.0000 -0.0000 1.0000 22 | vn 0.0000 -1.0000 -0.0000 23 | vn 1.0000 0.0000 -0.0000 24 | vn 0.0000 1.0000 0.0000 25 | vn -1.0000 0.0000 -0.0000 26 | # 6 vertex normals 27 | 28 | vt 0.0005 0.0005 0.5000 29 | vt 0.0005 0.9995 0.5000 30 | vt 0.9995 0.9995 0.5000 31 | vt 0.9995 0.0005 0.5000 32 | vt 0.0005 0.0005 1.5000 33 | vt 0.9995 0.0005 1.5000 34 | vt 0.9995 0.9995 1.5000 35 | vt 0.0005 0.9995 1.5000 36 | # 8 texture coords 37 | 38 | g Box01 39 | usemtl 01___Default 40 | s 2 41 | f 1/1/1 2/2/1 3/3/1 42 | f 3/3/1 4/4/1 1/1/1 43 | s 4 44 | f 5/5/2 6/6/2 7/7/2 45 | f 7/7/2 8/8/2 5/5/2 46 | s 8 47 | f 1/1/3 4/4/3 6/6/3 48 | f 6/6/3 5/5/3 1/1/3 49 | s 16 50 | f 4/4/4 3/3/4 7/7/4 51 | f 7/7/4 6/6/4 4/4/4 52 | s 32 53 | f 3/3/5 2/2/5 8/8/5 54 | f 8/8/5 7/7/5 3/3/5 55 | s 64 56 | f 2/2/6 1/1/6 5/5/6 57 | f 5/5/6 8/8/6 2/2/6 58 | # 12 faces 59 | 60 | -------------------------------------------------------------------------------- /data/obj/2dbox.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/2dbox.obj.png -------------------------------------------------------------------------------- /data/obj/athene.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 30.01.2015 01:56:27 3 | 4 | newmtl 02___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.0000 0.0000 0.0000 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka c:\Users\kpiorno\PycharmProjects\kivy3dgui\data\.debug\guide.jpg 16 | map_Kd c:\Users\kpiorno\PycharmProjects\kivy3dgui\data\.debug\guide.jpg 17 | -------------------------------------------------------------------------------- /data/obj/athene.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/athene.obj.png -------------------------------------------------------------------------------- /data/obj/bendbox.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 19.01.2015 20:49:28 3 | 4 | newmtl 01___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5882 0.5882 0.5882 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka C:\Users\kpiorno\Desktop\TTIIl.gif 16 | map_Kd C:\Users\kpiorno\Desktop\TTIIl.gif 17 | -------------------------------------------------------------------------------- /data/obj/bendbox.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 19.01.2015 20:49:28 3 | 4 | mtllib bendbox.mtl 5 | 6 | # 7 | # object Box01 8 | # 9 | o Box 10 | v -22.5691 -2.5989 22.5922 11 | v -22.5691 -2.5989 -22.5918 12 | v 22.6149 -2.5989 -22.5918 13 | v 22.6149 -2.5989 22.5922 14 | v -14.8994 35.0845 33.9629 15 | v 26.9790 18.8434 29.0623 16 | v 31.8797 42.9218 -8.8562 17 | v -9.9988 59.1628 -3.9555 18 | v 22.6603 -0.2720 22.6595 19 | v -22.4893 1.4905 22.7106 20 | v 22.7964 2.0436 22.8613 21 | v -22.2501 5.5601 23.0652 22 | v 23.0225 4.3367 23.1965 23 | v -21.8527 9.5899 23.6542 24 | v 23.3375 6.5959 23.6635 25 | v -21.2992 13.5603 24.4749 26 | v 23.7398 8.8103 24.2600 27 | v -20.5921 17.4520 25.5232 28 | v 24.2276 10.9691 24.9831 29 | v -19.7349 21.2460 26.7941 30 | v 24.7984 13.0619 25.8293 31 | v -18.7318 24.9238 28.2812 32 | v 25.4494 15.0783 26.7944 33 | v -17.5877 28.4676 29.9774 34 | v 26.1774 17.0086 27.8739 35 | v -16.3082 31.8599 31.8744 36 | v 22.7113 2.3410 -22.4488 37 | v 23.0003 7.2570 -22.0205 38 | v 23.4803 12.1249 -21.3089 39 | v 24.1489 16.9210 -20.3175 40 | v 25.0031 21.6221 -19.0512 41 | v 26.0385 26.2052 -17.5161 42 | v 27.2502 30.6479 -15.7196 43 | v 28.6323 34.9287 -13.6707 44 | v 30.1779 39.0266 -11.3791 45 | v -22.4382 4.1035 -22.3978 46 | v -22.0462 10.7734 -21.8166 47 | v -21.3950 17.3781 -20.8511 48 | v -20.4877 23.8854 -19.5060 49 | v -19.3288 30.2638 -17.7879 50 | v -17.9239 36.4820 -15.7051 51 | v -16.2799 42.5099 -13.2677 52 | v -14.4048 48.3179 -10.4877 53 | v -12.3077 53.8779 -7.3786 54 | # 44 vertices 55 | 56 | vn -0.0000 -1.0000 -0.0000 57 | vn 0.3594 0.7660 0.5329 58 | vn 0.0000 -0.0289 0.9996 59 | vn -0.0011 -0.0578 0.9983 60 | vn -0.0045 -0.1154 0.9933 61 | vn -0.0101 -0.1724 0.9850 62 | vn -0.0180 -0.2285 0.9734 63 | vn -0.0280 -0.2835 0.9586 64 | vn -0.0401 -0.3372 0.9406 65 | vn -0.0543 -0.3892 0.9195 66 | vn -0.0704 -0.4393 0.8956 67 | vn -0.0885 -0.4873 0.8687 68 | vn -0.0980 -0.5105 0.8543 69 | vn 0.9998 -0.0195 0.0000 70 | vn 0.9998 -0.0195 -0.0000 71 | vn 0.9992 -0.0390 -0.0011 72 | vn 0.9970 -0.0778 -0.0045 73 | vn 0.9932 -0.1163 -0.0101 74 | vn 0.9879 -0.1541 -0.0180 75 | vn 0.9811 -0.1913 -0.0280 76 | vn 0.9730 -0.2274 -0.0401 77 | vn 0.9634 -0.2625 -0.0543 78 | vn 0.9525 -0.2963 -0.0704 79 | vn 0.9403 -0.3287 -0.0885 80 | vn 0.9337 -0.3444 -0.0980 81 | vn -0.0000 0.0289 -0.9996 82 | vn 0.0011 0.0578 -0.9983 83 | vn 0.0045 0.1154 -0.9933 84 | vn 0.0101 0.1724 -0.9850 85 | vn 0.0180 0.2285 -0.9734 86 | vn 0.0280 0.2835 -0.9586 87 | vn 0.0401 0.3372 -0.9406 88 | vn 0.0543 0.3892 -0.9195 89 | vn 0.0704 0.4393 -0.8956 90 | vn 0.0885 0.4873 -0.8687 91 | vn 0.0980 0.5105 -0.8543 92 | vn -0.9998 0.0195 0.0000 93 | vn -0.9992 0.0390 0.0011 94 | vn -0.9970 0.0778 0.0045 95 | vn -0.9932 0.1163 0.0101 96 | vn -0.9879 0.1541 0.0180 97 | vn -0.9811 0.1913 0.0280 98 | vn -0.9730 0.2274 0.0401 99 | vn -0.9634 0.2625 0.0543 100 | vn -0.9525 0.2963 0.0704 101 | vn -0.9403 0.3287 0.0885 102 | vn -0.9337 0.3444 0.0980 103 | # 47 vertex normals 104 | 105 | vt 0.0000 0.0000 0.0000 106 | vt 1.0000 0.0000 0.0000 107 | vt 1.0000 1.0000 0.0000 108 | vt 0.0000 1.0000 0.0000 109 | # 4 texture coords 110 | 111 | g Box01 112 | usemtl 01___Default 113 | s 2 114 | f 1/1/1 2/2/1 3/3/1 115 | f 3/3/1 4/4/1 1/1/1 116 | s 4 117 | f 5/1/2 6/2/2 7/3/2 118 | f 7/3/2 8/4/2 5/1/2 119 | s 8 120 | f 1/1/3 4/2/3 9/3/4 121 | f 9/3/4 10/4/4 1/1/3 122 | f 10/1/4 9/2/4 11/3/5 123 | f 11/3/5 12/4/5 10/1/4 124 | f 12/1/5 11/2/5 13/3/6 125 | f 13/3/6 14/4/6 12/1/5 126 | f 14/1/6 13/2/6 15/3/7 127 | f 15/3/7 16/4/7 14/1/6 128 | f 16/1/7 15/2/7 17/3/8 129 | f 17/3/8 18/4/8 16/1/7 130 | f 18/1/8 17/2/8 19/3/9 131 | f 19/3/9 20/4/9 18/1/8 132 | f 20/1/9 19/2/9 21/3/10 133 | f 21/3/10 22/4/10 20/1/9 134 | f 22/1/10 21/2/10 23/3/11 135 | f 23/3/11 24/4/11 22/1/10 136 | f 24/1/11 23/2/11 25/3/12 137 | f 25/3/12 26/4/12 24/1/11 138 | f 26/3/12 25/4/12 6/1/13 139 | f 6/1/13 5/2/13 26/3/12 140 | s 16 141 | f 4/1/14 3/2/15 27/3/16 142 | f 27/3/16 9/4/16 4/1/14 143 | f 9/1/16 27/2/16 28/3/17 144 | f 28/3/17 11/4/17 9/1/16 145 | f 11/1/17 28/2/17 29/3/18 146 | f 29/3/18 13/4/18 11/1/17 147 | f 13/1/18 29/2/18 30/3/19 148 | f 30/3/19 15/4/19 13/1/18 149 | f 15/1/19 30/2/19 31/3/20 150 | f 31/3/20 17/4/20 15/1/19 151 | f 17/1/20 31/2/20 32/3/21 152 | f 32/3/21 19/4/21 17/1/20 153 | f 19/1/21 32/2/21 33/3/22 154 | f 33/3/22 21/4/22 19/1/21 155 | f 21/1/22 33/2/22 34/3/23 156 | f 34/3/23 23/4/23 21/1/22 157 | f 23/1/23 34/2/23 35/3/24 158 | f 35/3/24 25/4/24 23/1/23 159 | f 25/3/24 35/4/24 7/1/25 160 | f 7/1/25 6/2/25 25/3/24 161 | s 32 162 | f 3/1/26 2/2/26 36/3/27 163 | f 36/3/27 27/4/27 3/1/26 164 | f 27/1/27 36/2/27 37/3/28 165 | f 37/3/28 28/4/28 27/1/27 166 | f 28/1/28 37/2/28 38/3/29 167 | f 38/3/29 29/4/29 28/1/28 168 | f 29/1/29 38/2/29 39/3/30 169 | f 39/3/30 30/4/30 29/1/29 170 | f 30/1/30 39/2/30 40/3/31 171 | f 40/3/31 31/4/31 30/1/30 172 | f 31/1/31 40/2/31 41/3/32 173 | f 41/3/32 32/4/32 31/1/31 174 | f 32/1/32 41/2/32 42/3/33 175 | f 42/3/33 33/4/33 32/1/32 176 | f 33/1/33 42/2/33 43/3/34 177 | f 43/3/34 34/4/34 33/1/33 178 | f 34/1/34 43/2/34 44/3/35 179 | f 44/3/35 35/4/35 34/1/34 180 | f 35/3/35 44/4/35 8/1/36 181 | f 8/1/36 7/2/36 35/3/35 182 | s 64 183 | f 2/1/37 1/2/37 10/3/38 184 | f 10/3/38 36/4/38 2/1/37 185 | f 36/1/38 10/2/38 12/3/39 186 | f 12/3/39 37/4/39 36/1/38 187 | f 37/1/39 12/2/39 14/3/40 188 | f 14/3/40 38/4/40 37/1/39 189 | f 38/1/40 14/2/40 16/3/41 190 | f 16/3/41 39/4/41 38/1/40 191 | f 39/1/41 16/2/41 18/3/42 192 | f 18/3/42 40/4/42 39/1/41 193 | f 40/1/42 18/2/42 20/3/43 194 | f 20/3/43 41/4/43 40/1/42 195 | f 41/1/43 20/2/43 22/3/44 196 | f 22/3/44 42/4/44 41/1/43 197 | f 42/1/44 22/2/44 24/3/45 198 | f 24/3/45 43/4/45 42/1/44 199 | f 43/1/45 24/2/45 26/3/46 200 | f 26/3/46 44/4/46 43/1/45 201 | f 44/3/46 26/4/46 5/1/47 202 | f 5/1/47 8/2/47 44/3/46 203 | # 84 faces 204 | 205 | -------------------------------------------------------------------------------- /data/obj/box.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 25.12.2014 23:39:15 3 | 4 | newmtl 01___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5882 0.5882 0.5882 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka d:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\box.obj.png 16 | map_Kd d:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\box.obj.png 17 | -------------------------------------------------------------------------------- /data/obj/box.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 25.12.2014 23:39:15 3 | 4 | mtllib box.mtl 5 | 6 | # 7 | # object Box01 8 | # 9 | o Box 10 | v -2.5135 -2.6053 2.3499 11 | v -2.5135 -2.6053 -2.6501 12 | v 2.4865 -2.6053 -2.6501 13 | v 2.4865 -2.6053 2.3499 14 | v -2.5135 2.3947 2.3499 15 | v 2.4865 2.3947 2.3499 16 | v 2.4865 2.3947 -2.6501 17 | v -2.5135 2.3947 -2.6501 18 | # 8 vertices 19 | 20 | vn 0.0000 -1.0000 -0.0000 21 | vn 0.0000 1.0000 -0.0000 22 | vn 0.0000 0.0000 1.0000 23 | vn 1.0000 0.0000 -0.0000 24 | vn 0.0000 0.0000 -1.0000 25 | vn -1.0000 0.0000 -0.0000 26 | # 6 vertex normals 27 | 28 | vt 0.9995 0.0005 0.0005 29 | vt 0.9995 0.9995 0.0005 30 | vt 0.0005 0.9995 0.0005 31 | vt 0.0005 0.0005 0.0005 32 | vt 0.0005 0.0005 0.9995 33 | vt 0.9995 0.0005 0.9995 34 | vt 0.9995 0.9995 0.9995 35 | vt 0.0005 0.9995 0.9995 36 | # 8 texture coords 37 | 38 | g Box01 39 | usemtl 01___Default 40 | s 2 41 | f 1/1/1 2/2/1 3/3/1 42 | f 3/3/1 4/4/1 1/1/1 43 | s 4 44 | f 5/5/2 6/6/2 7/7/2 45 | f 7/7/2 8/8/2 5/5/2 46 | s 8 47 | f 1/4/3 4/1/3 6/2/3 48 | f 6/2/3 5/3/3 1/4/3 49 | s 16 50 | f 4/5/4 3/6/4 7/7/4 51 | f 7/7/4 6/8/4 4/5/4 52 | s 32 53 | f 3/5/5 2/6/5 8/7/5 54 | f 8/7/5 7/8/5 3/5/5 55 | s 64 56 | f 2/4/6 1/1/6 5/2/6 57 | f 5/2/6 8/3/6 2/4/6 58 | # 12 faces 59 | 60 | -------------------------------------------------------------------------------- /data/obj/box_sphere.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 20.01.2015 23:11:07 3 | 4 | newmtl wire_166229229 5 | Ns 32 6 | d 1 7 | Tr 0 8 | Tf 1 1 1 9 | illum 2 10 | Ka 0.0000 0.0000 0.0000 11 | Kd 0.6510 0.8980 0.8980 12 | Ks 0.3500 0.3500 0.3500 13 | -------------------------------------------------------------------------------- /data/obj/box_sphere.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/box_sphere.obj.png -------------------------------------------------------------------------------- /data/obj/cbox.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 17.09.2014 00:02:00 3 | 4 | newmtl 01___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5882 0.5882 0.5882 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka C:\Users\kpiorno\Documents\3dsMax\sceneassets\images\Sphere01ShadowsMap.tga 16 | map_Kd C:\Users\kpiorno\Documents\3dsMax\sceneassets\images\Sphere01ShadowsMap.tga 17 | -------------------------------------------------------------------------------- /data/obj/cbox.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 17.09.2014 00:02:00 3 | 4 | mtllib cbox.mtl 5 | 6 | # 7 | # object Box01 8 | # 9 | o Box 10 | v -27.3004 -23.9516 0.6435 11 | v -27.3004 21.8601 0.4973 12 | v 26.7167 21.8601 0.4973 13 | v 26.7167 -23.9516 0.6435 14 | # 4 vertices 15 | 16 | vn 0.0000 -0.0032 -1.0000 17 | vn 0.0000 0.0032 1.0000 18 | vn 1.0000 0.0000 -0.0000 19 | # 3 vertex normals 20 | 21 | vt 1.3028 -0.1809 0.5000 22 | vt 1.3028 1.1809 0.5000 23 | vt -0.3028 1.1809 0.5000 24 | vt -0.3028 -0.1809 0.5000 25 | vt -0.1809 0.5000 -0.3028 26 | vt -0.1809 0.5000 1.3028 27 | vt 1.1809 0.5000 1.3028 28 | vt 1.1809 0.5000 -0.3028 29 | # 8 texture coords 30 | 31 | g Box01 32 | usemtl 01___Default 33 | s 2 34 | f 1/1/1 2/2/1 3/3/1 35 | f 3/3/1 4/4/1 1/1/1 36 | s 4 37 | f 1/4/2 4/1/2 3/2/2 38 | f 3/2/2 2/3/2 1/4/2 39 | s 8 40 | f 1/5/3 4/6/3 4/6/3 41 | f 4/6/3 1/5/3 1/5/3 42 | s 16 43 | f 4/6/3 3/7/3 3/7/3 44 | f 3/7/3 4/6/3 4/6/3 45 | s 32 46 | f 3/7/3 2/8/3 2/8/3 47 | f 2/8/3 3/7/3 3/7/3 48 | s 64 49 | f 2/8/3 1/5/3 1/5/3 50 | f 1/5/3 2/8/3 2/8/3 51 | # 12 faces 52 | 53 | -------------------------------------------------------------------------------- /data/obj/drawer.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 02.12.2016 01:39:18 3 | 4 | mtllib drawer.mtl 5 | 6 | o Drawer 7 | v -1.1832 1.0388 2.6773 8 | v -1.0787 1.1433 2.6773 9 | v -1.0354 1.0388 2.6773 10 | v -1.1832 1.1866 2.6773 11 | v -1.2877 1.1433 2.6773 12 | v -1.3310 1.0388 2.6773 13 | v -1.2877 0.9343 2.6773 14 | v -1.1832 0.8910 2.6773 15 | v -1.0787 0.9343 2.6773 16 | v -1.0787 1.1433 2.7208 17 | v -1.0354 1.0388 2.7208 18 | v -1.1832 1.1866 2.7208 19 | v -1.2877 1.1433 2.7208 20 | v -1.3310 1.0388 2.7208 21 | v -1.2877 0.9343 2.7208 22 | v -1.1832 0.8910 2.7208 23 | v -1.0787 0.9343 2.7208 24 | v -1.1832 1.0388 2.7208 25 | v -2.2268 0.6560 0.7208 26 | v -2.2268 1.3443 0.7208 27 | v -0.2118 1.3443 0.7208 28 | v -0.2118 0.6560 0.7208 29 | v -2.2268 0.6560 2.6857 30 | v -0.2118 0.6560 2.6857 31 | v -0.2118 1.3443 2.6857 32 | v -2.2268 1.3443 2.6857 33 | v -2.0965 1.3443 2.6190 34 | v -2.0965 1.3443 0.9082 35 | v -0.3421 1.3443 0.9082 36 | v -0.3421 1.3443 2.6190 37 | v -0.3421 0.7719 2.6190 38 | v -0.3421 0.7719 0.9082 39 | v -2.0965 0.7719 0.9082 40 | v -2.0965 0.7719 2.6190 41 | # 34 vertices 42 | 43 | vn 0.0000 0.0000 -1.0000 44 | vn 1.0000 -0.0000 -0.0000 45 | vn 0.7071 0.7071 0.0000 46 | vn -0.0000 1.0000 0.0000 47 | vn 0.0000 1.0000 0.0000 48 | vn -0.7071 0.7071 0.0000 49 | vn -1.0000 -0.0000 -0.0000 50 | vn -0.7071 -0.7071 -0.0000 51 | vn 0.0000 -1.0000 -0.0000 52 | vn -0.0000 -1.0000 -0.0000 53 | vn 0.7071 -0.7071 -0.0000 54 | vn 0.0000 -0.0000 1.0000 55 | vn 1.0000 0.0000 -0.0000 56 | vn -1.0000 0.0000 -0.0000 57 | vn 0.0000 -0.0000 -1.0000 58 | # 15 vertex normals 59 | 60 | vt 0.6693 0.4152 0.0000 61 | vt 0.6483 0.4062 0.0000 62 | vt 0.6608 0.3939 0.0000 63 | vt 0.6481 0.4237 0.0000 64 | vt 0.6603 0.4362 0.0000 65 | vt 0.6779 0.4364 0.0000 66 | vt 0.6904 0.4241 0.0000 67 | vt 0.6905 0.4066 0.0000 68 | vt 0.6783 0.3941 0.0000 69 | vt 0.9625 0.0200 0.0000 70 | vt 0.9800 0.0267 0.0000 71 | vt 0.9625 0.0267 0.0000 72 | vt 0.9800 0.0200 0.0000 73 | vt 0.9476 0.0621 0.0000 74 | vt 0.9638 0.0688 0.0000 75 | vt 0.9476 0.0688 0.0000 76 | vt 0.9638 0.0621 0.0000 77 | vt 0.9800 0.0688 0.0000 78 | vt 0.9800 0.0621 0.0000 79 | vt 0.9034 0.0621 0.0000 80 | vt 0.9209 0.0688 0.0000 81 | vt 0.9034 0.0688 0.0000 82 | vt 0.9209 0.0621 0.0000 83 | vt 0.9333 0.0688 0.0000 84 | vt 0.9333 0.0621 0.0000 85 | vt 0.9476 0.0410 0.0000 86 | vt 0.9638 0.0478 0.0000 87 | vt 0.9476 0.0478 0.0000 88 | vt 0.9638 0.0410 0.0000 89 | vt 0.9800 0.0478 0.0000 90 | vt 0.9800 0.0410 0.0000 91 | vt 0.9501 0.0200 0.0000 92 | vt 0.9501 0.0267 0.0000 93 | vt 0.6693 0.7285 0.0000 94 | vt 0.6608 0.7072 0.0000 95 | vt 0.6783 0.7074 0.0000 96 | vt 0.6905 0.7199 0.0000 97 | vt 0.6904 0.7374 0.0000 98 | vt 0.6779 0.7497 0.0000 99 | vt 0.6603 0.7495 0.0000 100 | vt 0.6481 0.7370 0.0000 101 | vt 0.6483 0.7195 0.0000 102 | vt 0.3785 0.6608 0.0000 103 | vt 0.3785 0.5542 0.0000 104 | vt 0.6905 0.5542 0.0000 105 | vt 0.6905 0.6608 0.0000 106 | vt 0.3785 0.8675 0.0000 107 | vt 0.6905 0.8675 0.0000 108 | vt 0.6905 0.9742 0.0000 109 | vt 0.3785 0.9742 0.0000 110 | vt 0.3243 0.0200 0.0000 111 | vt 0.3243 0.3321 0.0000 112 | vt 0.0200 0.3321 0.0000 113 | vt 0.0200 0.0200 0.0000 114 | vt 0.3243 0.8522 0.0000 115 | vt 0.3243 0.9588 0.0000 116 | vt 0.0200 0.9588 0.0000 117 | vt 0.0200 0.8522 0.0000 118 | vt 0.9800 0.1956 0.0000 119 | vt 0.9800 0.3022 0.0000 120 | vt 0.6757 0.3022 0.0000 121 | vt 0.6757 0.1956 0.0000 122 | vt 0.3321 0.6983 0.0000 123 | vt 0.3119 0.6879 0.0000 124 | vt 0.3119 0.4230 0.0000 125 | vt 0.3321 0.3939 0.0000 126 | vt 0.0402 0.4230 0.0000 127 | vt 0.0200 0.3939 0.0000 128 | vt 0.0200 0.6983 0.0000 129 | vt 0.0402 0.6879 0.0000 130 | vt 0.3488 0.0603 0.0000 131 | vt 0.6138 0.0603 0.0000 132 | vt 0.6138 0.3321 0.0000 133 | vt 0.3488 0.3321 0.0000 134 | vt 0.9800 0.0878 0.0000 135 | vt 0.9800 0.1765 0.0000 136 | vt 0.7150 0.1765 0.0000 137 | vt 0.7150 0.0878 0.0000 138 | vt 0.6905 0.4510 0.0000 139 | vt 0.6905 0.5396 0.0000 140 | vt 0.4188 0.5396 0.0000 141 | vt 0.4188 0.4510 0.0000 142 | vt 0.0593 0.8333 0.0000 143 | vt 0.0593 0.7447 0.0000 144 | vt 0.3243 0.7447 0.0000 145 | vt 0.3243 0.8333 0.0000 146 | vt 0.4188 0.8530 0.0000 147 | vt 0.4188 0.7643 0.0000 148 | vt 0.6905 0.7643 0.0000 149 | vt 0.6905 0.8530 0.0000 150 | # 90 texture coords 151 | 152 | g Cylinder05 153 | usemtl 09___Default 154 | s 1 155 | f 1/1/1 2/2/1 3/3/1 156 | f 1/1/1 4/4/1 2/2/1 157 | f 1/1/1 5/5/1 4/4/1 158 | f 1/1/1 6/6/1 5/5/1 159 | f 1/1/1 7/7/1 6/6/1 160 | f 1/1/1 8/8/1 7/7/1 161 | f 1/1/1 9/9/1 8/8/1 162 | f 1/1/1 3/3/1 9/9/1 163 | s 8 164 | f 3/10/2 10/11/3 11/12/2 165 | f 3/10/2 2/13/3 10/11/3 166 | f 2/14/3 12/15/4 10/16/3 167 | f 2/14/3 4/17/5 12/15/4 168 | f 4/17/5 13/18/6 12/15/4 169 | f 4/17/5 5/19/6 13/18/6 170 | f 5/20/6 14/21/7 13/22/6 171 | f 5/20/6 6/23/7 14/21/7 172 | f 6/23/7 15/24/8 14/21/7 173 | f 6/23/7 7/25/8 15/24/8 174 | f 7/26/8 16/27/9 15/28/8 175 | f 7/26/8 8/29/10 16/27/9 176 | f 8/29/10 17/30/11 16/27/9 177 | f 8/29/10 9/31/11 17/30/11 178 | f 9/32/11 11/12/2 17/33/11 179 | f 9/32/11 3/10/2 11/12/2 180 | s 1 181 | f 18/34/12 11/35/12 10/36/12 182 | f 18/34/12 10/36/12 12/37/12 183 | f 18/34/12 12/37/12 13/38/12 184 | f 18/34/12 13/38/12 14/39/12 185 | f 18/34/12 14/39/12 15/40/12 186 | f 18/34/12 15/40/12 16/41/12 187 | f 18/34/12 16/41/12 17/42/12 188 | f 18/34/12 17/42/12 11/35/12 189 | s 2 190 | f 19/43/1 20/44/1 21/45/1 191 | f 21/45/1 22/46/1 19/43/1 192 | s 4 193 | f 23/47/12 24/48/12 25/49/12 194 | f 25/49/12 26/50/12 23/47/12 195 | s 8 196 | f 19/51/9 22/52/9 24/53/9 197 | f 24/53/9 23/54/9 19/51/9 198 | s 16 199 | f 22/55/13 21/56/13 25/57/13 200 | f 25/57/13 24/58/13 22/55/13 201 | s 64 202 | f 20/59/14 19/60/14 23/61/14 203 | f 23/61/14 26/62/14 20/59/14 204 | s 32 205 | f 26/63/5 27/64/5 28/65/5 206 | f 20/66/5 26/63/5 28/65/5 207 | f 20/66/5 28/65/5 29/67/5 208 | f 21/68/5 20/66/5 29/67/5 209 | f 25/69/5 21/68/5 29/67/5 210 | f 25/69/5 29/67/5 30/70/5 211 | f 26/63/5 25/69/5 30/70/5 212 | f 27/64/5 26/63/5 30/70/5 213 | s 8 214 | f 31/71/5 32/72/5 33/73/5 215 | f 33/73/5 34/74/5 31/71/5 216 | s 64 217 | f 33/75/13 28/76/13 27/77/13 218 | f 27/77/13 34/78/13 33/75/13 219 | s 2 220 | f 32/79/12 29/80/12 28/81/12 221 | f 28/81/12 33/82/12 32/79/12 222 | s 16 223 | f 31/83/14 30/84/14 29/85/14 224 | f 29/85/14 32/86/14 31/83/14 225 | s 4 226 | f 34/87/15 27/88/15 30/89/1 227 | f 30/89/1 31/90/1 34/87/15 228 | # 60 faces 229 | 230 | -------------------------------------------------------------------------------- /data/obj/objs.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 26.12.2014 13:59:51 3 | 4 | newmtl 01___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5882 0.5882 0.5882 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka D:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\objs.obj.png 16 | map_Kd D:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\objs.obj.png 17 | -------------------------------------------------------------------------------- /data/obj/objs.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 26.12.2014 13:59:51 3 | 4 | mtllib objs.mtl 5 | 6 | # 7 | # object Cylinder01 8 | # 9 | o Tank 10 | v 0.0000 0.0199 -2.7521 11 | v 17.9023 10.3557 -2.7521 12 | v 20.6717 0.0199 -2.7521 13 | v 10.3359 17.9221 -2.7521 14 | v -0.0000 20.6916 -2.7521 15 | v -10.3359 17.9221 -2.7521 16 | v -17.9023 10.3557 -2.7521 17 | v -20.6717 0.0199 -2.7521 18 | v -17.9023 -10.3160 -2.7521 19 | v -10.3359 -17.8824 -2.7521 20 | v -0.0000 -20.6519 -2.7521 21 | v 10.3359 -17.8824 -2.7521 22 | v 17.9023 -10.3160 -2.7521 23 | v 17.9023 10.3557 2.7179 24 | v 20.6717 0.0199 2.7179 25 | v 10.3359 17.9221 2.7179 26 | v -0.0000 20.6916 2.7179 27 | v -10.3359 17.9221 2.7179 28 | v -17.9023 10.3557 2.7179 29 | v -20.6717 0.0199 2.7179 30 | v -17.9023 -10.3160 2.7179 31 | v -10.3359 -17.8824 2.7179 32 | v -0.0000 -20.6519 2.7179 33 | v 10.3359 -17.8824 2.7179 34 | v 17.9023 -10.3160 2.7179 35 | v 0.0000 0.0199 2.7179 36 | # 26 vertices 37 | 38 | vn 0.0000 0.0000 -1.0000 39 | vn 1.0000 -0.0000 -0.0000 40 | vn 0.8660 0.5000 0.0000 41 | vn 0.5000 0.8660 0.0000 42 | vn -0.0000 1.0000 0.0000 43 | vn 0.0000 1.0000 0.0000 44 | vn -0.5000 0.8660 0.0000 45 | vn -0.8660 0.5000 0.0000 46 | vn -1.0000 0.0000 0.0000 47 | vn -0.8660 -0.5000 -0.0000 48 | vn -0.5000 -0.8660 -0.0000 49 | vn -0.0000 -1.0000 -0.0000 50 | vn 0.5000 -0.8660 -0.0000 51 | vn 0.8660 -0.5000 -0.0000 52 | vn 0.0000 -0.0000 1.0000 53 | # 15 vertex normals 54 | 55 | vt 0.5000 0.5000 0.0005 56 | vt 0.9326 0.7536 0.0005 57 | vt 0.9995 0.5000 0.0005 58 | vt 0.7498 0.9393 0.0005 59 | vt 0.5000 1.0072 0.0005 60 | vt 0.2502 0.9393 0.0005 61 | vt 0.0674 0.7536 0.0005 62 | vt 0.0005 0.5000 0.0005 63 | vt 0.0674 0.2464 0.0005 64 | vt 0.2502 0.0607 0.0005 65 | vt 0.5000 -0.0072 0.0005 66 | vt 0.7497 0.0607 0.0005 67 | vt 0.9326 0.2464 0.0005 68 | vt 0.9326 0.7536 0.9995 69 | vt 0.9995 0.5000 0.9995 70 | vt 0.7498 0.9393 0.9995 71 | vt 0.5000 1.0072 0.9995 72 | vt 0.2502 0.9393 0.9995 73 | vt 0.0674 0.7536 0.9995 74 | vt 0.0005 0.5000 0.9995 75 | vt 0.0674 0.2464 0.9995 76 | vt 0.2502 0.0607 0.9995 77 | vt 0.5000 -0.0072 0.9995 78 | vt 0.7497 0.0607 0.9995 79 | vt 0.9326 0.2464 0.9995 80 | vt 0.5000 0.5000 0.9995 81 | # 26 texture coords 82 | 83 | g Cylinder01 84 | usemtl 01___Default 85 | s 1 86 | f 1/1/1 2/2/1 3/3/1 87 | f 1/1/1 4/4/1 2/2/1 88 | f 1/1/1 5/5/1 4/4/1 89 | f 1/1/1 6/6/1 5/5/1 90 | f 1/1/1 7/7/1 6/6/1 91 | f 1/1/1 8/8/1 7/7/1 92 | f 1/1/1 9/9/1 8/8/1 93 | f 1/1/1 10/10/1 9/9/1 94 | f 1/1/1 11/11/1 10/10/1 95 | f 1/1/1 12/12/1 11/11/1 96 | f 1/1/1 13/13/1 12/12/1 97 | f 1/1/1 3/3/1 13/13/1 98 | s 8 99 | f 3/3/2 14/14/3 15/15/2 100 | f 3/3/2 2/2/3 14/14/3 101 | f 2/2/3 16/16/4 14/14/3 102 | f 2/2/3 4/4/4 16/16/4 103 | f 4/4/4 17/17/5 16/16/4 104 | f 4/4/4 5/5/6 17/17/5 105 | f 5/5/6 18/18/7 17/17/5 106 | f 5/5/6 6/6/7 18/18/7 107 | f 6/6/7 19/19/8 18/18/7 108 | f 6/6/7 7/7/8 19/19/8 109 | f 7/7/8 20/20/9 19/19/8 110 | f 7/7/8 8/8/9 20/20/9 111 | f 8/8/9 21/21/10 20/20/9 112 | f 8/8/9 9/9/10 21/21/10 113 | f 9/9/10 22/22/11 21/21/10 114 | f 9/9/10 10/10/11 22/22/11 115 | f 10/10/11 23/23/12 22/22/11 116 | f 10/10/11 11/11/12 23/23/12 117 | f 11/11/12 24/24/13 23/23/12 118 | f 11/11/12 12/12/13 24/24/13 119 | f 12/12/13 25/25/14 24/24/13 120 | f 12/12/13 13/13/14 25/25/14 121 | f 13/13/14 15/15/2 25/25/14 122 | f 13/13/14 3/3/2 15/15/2 123 | s 1 124 | f 26/26/15 15/15/15 14/14/15 125 | f 26/26/15 14/14/15 16/16/15 126 | f 26/26/15 16/16/15 17/17/15 127 | f 26/26/15 17/17/15 18/18/15 128 | f 26/26/15 18/18/15 19/19/15 129 | f 26/26/15 19/19/15 20/20/15 130 | f 26/26/15 20/20/15 21/21/15 131 | f 26/26/15 21/21/15 22/22/15 132 | f 26/26/15 22/22/15 23/23/15 133 | f 26/26/15 23/23/15 24/24/15 134 | f 26/26/15 24/24/15 25/25/15 135 | f 26/26/15 25/25/15 15/15/15 136 | # 48 faces 137 | 138 | -------------------------------------------------------------------------------- /data/obj/objs.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/objs.obj.png -------------------------------------------------------------------------------- /data/obj/sphere.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 05.09.2014 15:10:28 3 | 4 | newmtl wire_177028149 5 | Ns 32 6 | d 1 7 | Tr 0 8 | Tf 1 1 1 9 | illum 2 10 | Ka 0.6941 0.1098 0.5843 11 | Kd 0.6941 0.1098 0.5843 12 | Ks 0.3500 0.3500 0.3500 13 | -------------------------------------------------------------------------------- /data/obj/spherelow.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 30.08.2016 02:46:55 3 | 4 | newmtl wire_166229229 5 | Ns 32 6 | d 1 7 | Tr 0 8 | Tf 1 1 1 9 | illum 2 10 | Ka 0.6510 0.8980 0.8980 11 | Kd 0.6510 0.8980 0.8980 12 | Ks 0.3500 0.3500 0.3500 13 | -------------------------------------------------------------------------------- /data/obj/spherelow.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 30.08.2016 02:46:55 3 | 4 | mtllib spherelow.mtl 5 | 6 | # 7 | # object Sphere01 8 | # 9 | o S 10 | v 0.0000 27.3787 -0.1770 11 | v -0.0000 25.9089 -7.0915 12 | v -2.8124 25.9089 -6.4937 13 | v -5.1385 25.9089 -4.8037 14 | v -6.5761 25.9089 -2.3137 15 | v -6.8766 25.9089 0.5458 16 | v -5.9882 25.9089 3.2803 17 | v -4.0643 25.9089 5.4170 18 | v -1.4376 25.9089 6.5864 19 | v 1.4376 25.9089 6.5864 20 | v 4.0643 25.9089 5.4170 21 | v 5.9882 25.9089 3.2803 22 | v 6.8766 25.9089 0.5458 23 | v 6.5761 25.9089 -2.3137 24 | v 5.1385 25.9089 -4.8037 25 | v 2.8124 25.9089 -6.4937 26 | v -0.0000 21.7539 -12.8105 27 | v -5.1385 21.7539 -11.7182 28 | v -9.3885 21.7539 -8.6304 29 | v -12.0151 21.7539 -4.0809 30 | v -12.5643 21.7539 1.1436 31 | v -10.9409 21.7539 6.1397 32 | v -7.4258 21.7539 10.0437 33 | v -2.6266 21.7539 12.1804 34 | v 2.6266 21.7539 12.1804 35 | v 7.4258 21.7539 10.0437 36 | v 10.9409 21.7539 6.1397 37 | v 12.5643 21.7539 1.1436 38 | v 12.0151 21.7539 -4.0809 39 | v 9.3885 21.7539 -8.6304 40 | v 5.1385 21.7539 -11.7182 41 | v -0.0000 15.6319 -16.3450 42 | v -6.5761 15.6319 -14.9472 43 | v -12.0151 15.6319 -10.9955 44 | v -15.3766 15.6319 -5.1732 45 | v -16.0794 15.6319 1.5130 46 | v -14.0019 15.6319 7.9070 47 | v -9.5033 15.6319 12.9032 48 | v -3.3615 15.6319 15.6377 49 | v 3.3615 15.6319 15.6377 50 | v 9.5033 15.6319 12.9032 51 | v 14.0019 15.6319 7.9070 52 | v 16.0794 15.6319 1.5130 53 | v 15.3766 15.6319 -5.1732 54 | v 12.0151 15.6319 -10.9955 55 | v 6.5761 15.6319 -14.9472 56 | v -0.0000 8.6017 -17.0839 57 | v -6.8766 8.6017 -15.6222 58 | v -12.5643 8.6017 -11.4899 59 | v -16.0794 8.6017 -5.4015 60 | v -16.8143 8.6017 1.5903 61 | v -14.6418 8.6017 8.2764 62 | v -9.9376 8.6017 13.5010 63 | v -3.5151 8.6017 16.3604 64 | v 3.5151 8.6017 16.3604 65 | v 9.9376 8.6017 13.5010 66 | v 14.6418 8.6017 8.2764 67 | v 16.8143 8.6017 1.5903 68 | v 16.0794 8.6017 -5.4015 69 | v 12.5643 8.6017 -11.4899 70 | v 6.8766 8.6017 -15.6222 71 | v -0.0000 1.8786 -14.8994 72 | v -5.9882 1.8786 -13.6266 73 | v -10.9409 1.8786 -10.0282 74 | v -14.0019 1.8786 -4.7265 75 | v -14.6418 1.8786 1.3619 76 | v -12.7500 1.8786 7.1842 77 | v -8.6536 1.8786 11.7337 78 | v -3.0610 1.8786 14.2237 79 | v 3.0610 1.8786 14.2237 80 | v 8.6536 1.8786 11.7337 81 | v 12.7500 1.8786 7.1842 82 | v 14.6418 1.8786 1.3619 83 | v 14.0019 1.8786 -4.7265 84 | v 10.9409 1.8786 -10.0282 85 | v 5.9881 1.8786 -13.6266 86 | v -0.0000 -3.3746 -10.1693 87 | v -4.0643 -3.3746 -9.3055 88 | v -7.4258 -3.3746 -6.8632 89 | v -9.5033 -3.3746 -3.2648 90 | v -9.9376 -3.3746 0.8675 91 | v -8.6536 -3.3746 4.8192 92 | v -5.8734 -3.3746 7.9070 93 | v -2.0775 -3.3746 9.5970 94 | v 2.0775 -3.3746 9.5970 95 | v 5.8734 -3.3746 7.9070 96 | v 8.6536 -3.3746 4.8192 97 | v 9.9376 -3.3746 0.8675 98 | v 9.5033 -3.3746 -3.2648 99 | v 7.4258 -3.3746 -6.8632 100 | v 4.0642 -3.3746 -9.3055 101 | v 0.0000 -6.6213 -0.1770 102 | # 92 vertices 103 | 104 | vn -0.0000 1.0000 -0.0000 105 | vn -0.0000 0.9031 -0.4293 106 | vn -0.1746 0.9031 -0.3922 107 | vn -0.3191 0.9031 -0.2873 108 | vn -0.4083 0.9031 -0.1327 109 | vn -0.4270 0.9031 0.0449 110 | vn -0.3718 0.9031 0.2147 111 | vn -0.2524 0.9031 0.3473 112 | vn -0.0893 0.9031 0.4199 113 | vn 0.0893 0.9031 0.4199 114 | vn 0.2524 0.9031 0.3473 115 | vn 0.3718 0.9031 0.2147 116 | vn 0.4270 0.9031 0.0449 117 | vn 0.4083 0.9031 -0.1327 118 | vn 0.3191 0.9031 -0.2873 119 | vn 0.1746 0.9031 -0.3922 120 | vn -0.0000 0.6557 -0.7550 121 | vn -0.3071 0.6557 -0.6897 122 | vn -0.5611 0.6557 -0.5052 123 | vn -0.7181 0.6557 -0.2333 124 | vn -0.7509 0.6557 0.0789 125 | vn -0.6539 0.6557 0.3775 126 | vn -0.4438 0.6557 0.6108 127 | vn -0.1570 0.6557 0.7385 128 | vn 0.1570 0.6557 0.7385 129 | vn 0.4438 0.6557 0.6108 130 | vn 0.6539 0.6557 0.3775 131 | vn 0.7509 0.6557 0.0789 132 | vn 0.7181 0.6557 -0.2333 133 | vn 0.5611 0.6557 -0.5052 134 | vn 0.3071 0.6557 -0.6897 135 | vn -0.0000 0.3012 -0.9536 136 | vn -0.3878 0.3012 -0.8711 137 | vn -0.7086 0.3012 -0.6381 138 | vn -0.9069 0.3012 -0.2947 139 | vn -0.9483 0.3012 0.0997 140 | vn -0.8258 0.3012 0.4768 141 | vn -0.5605 0.3012 0.7714 142 | vn -0.1983 0.3012 0.9327 143 | vn 0.1983 0.3012 0.9327 144 | vn 0.5605 0.3012 0.7714 145 | vn 0.8258 0.3012 0.4768 146 | vn 0.9483 0.3012 0.0997 147 | vn 0.9069 0.3012 -0.2947 148 | vn 0.7086 0.3012 -0.6381 149 | vn 0.3878 0.3012 -0.8711 150 | vn -0.0000 -0.1018 -0.9948 151 | vn -0.4046 -0.1018 -0.9088 152 | vn -0.7393 -0.1018 -0.6657 153 | vn -0.9461 -0.1018 -0.3074 154 | vn -0.9894 -0.1018 0.1040 155 | vn -0.8615 -0.1018 0.4974 156 | vn -0.5847 -0.1018 0.8048 157 | vn -0.2068 -0.1018 0.9731 158 | vn 0.2068 -0.1018 0.9731 159 | vn 0.5847 -0.1018 0.8048 160 | vn 0.8615 -0.1018 0.4974 161 | vn 0.9894 -0.1018 0.1040 162 | vn 0.9461 -0.1018 -0.3074 163 | vn 0.7393 -0.1018 -0.6657 164 | vn 0.4046 -0.1018 -0.9088 165 | vn -0.0000 -0.4884 -0.8726 166 | vn -0.3549 -0.4884 -0.7972 167 | vn -0.6485 -0.4884 -0.5839 168 | vn -0.8299 -0.4884 -0.2696 169 | vn -0.8678 -0.4884 0.0912 170 | vn -0.7557 -0.4884 0.4363 171 | vn -0.5129 -0.4884 0.7060 172 | vn -0.1814 -0.4884 0.8535 173 | vn 0.1814 -0.4884 0.8535 174 | vn 0.5129 -0.4884 0.7060 175 | vn 0.7557 -0.4884 0.4363 176 | vn 0.8678 -0.4884 0.0912 177 | vn 0.8299 -0.4884 -0.2697 178 | vn 0.6485 -0.4884 -0.5839 179 | vn 0.3549 -0.4884 -0.7972 180 | vn -0.0000 -0.8230 -0.5680 181 | vn -0.2310 -0.8230 -0.5189 182 | vn -0.4221 -0.8230 -0.3800 183 | vn -0.5402 -0.8230 -0.1755 184 | vn -0.5649 -0.8230 0.0594 185 | vn -0.4919 -0.8230 0.2840 186 | vn -0.3338 -0.8230 0.4595 187 | vn -0.1181 -0.8230 0.5556 188 | vn 0.1181 -0.8230 0.5556 189 | vn 0.3338 -0.8230 0.4595 190 | vn 0.4919 -0.8230 0.2840 191 | vn 0.5649 -0.8230 0.0594 192 | vn 0.5402 -0.8230 -0.1755 193 | vn 0.4221 -0.8230 -0.3800 194 | vn 0.2310 -0.8230 -0.5189 195 | vn 0.0000 -1.0000 -0.0000 196 | # 92 vertex normals 197 | 198 | vt 0.0000 1.0000 0.0000 199 | vt 0.0000 0.8667 0.0000 200 | vt 0.0667 0.8667 0.0000 201 | vt 0.0667 1.0000 0.0000 202 | vt 0.1333 0.8667 0.0000 203 | vt 0.1333 1.0000 0.0000 204 | vt 0.2000 0.8667 0.0000 205 | vt 0.2000 1.0000 0.0000 206 | vt 0.2667 0.8667 0.0000 207 | vt 0.2667 1.0000 0.0000 208 | vt 0.3333 0.8667 0.0000 209 | vt 0.3333 1.0000 0.0000 210 | vt 0.4000 0.8667 0.0000 211 | vt 0.4000 1.0000 0.0000 212 | vt 0.4667 0.8667 0.0000 213 | vt 0.4667 1.0000 0.0000 214 | vt 0.5333 0.8667 0.0000 215 | vt 0.5333 1.0000 0.0000 216 | vt 0.6000 0.8667 0.0000 217 | vt 0.6000 1.0000 0.0000 218 | vt 0.6667 0.8667 0.0000 219 | vt 0.6667 1.0000 0.0000 220 | vt 0.7333 0.8667 0.0000 221 | vt 0.7333 1.0000 0.0000 222 | vt 0.8000 0.8667 0.0000 223 | vt 0.8000 1.0000 0.0000 224 | vt 0.8667 0.8667 0.0000 225 | vt 0.8667 1.0000 0.0000 226 | vt 0.9333 0.8667 0.0000 227 | vt 0.9333 1.0000 0.0000 228 | vt 1.0000 0.8667 0.0000 229 | vt 0.0000 0.7333 0.0000 230 | vt 0.0667 0.7333 0.0000 231 | vt 0.1333 0.7333 0.0000 232 | vt 0.2000 0.7333 0.0000 233 | vt 0.2667 0.7333 0.0000 234 | vt 0.3333 0.7333 0.0000 235 | vt 0.4000 0.7333 0.0000 236 | vt 0.4667 0.7333 0.0000 237 | vt 0.5333 0.7333 0.0000 238 | vt 0.6000 0.7333 0.0000 239 | vt 0.6667 0.7333 0.0000 240 | vt 0.7333 0.7333 0.0000 241 | vt 0.8000 0.7333 0.0000 242 | vt 0.8667 0.7333 0.0000 243 | vt 0.9333 0.7333 0.0000 244 | vt 1.0000 0.7333 0.0000 245 | vt 0.0000 0.6000 0.0000 246 | vt 0.0667 0.6000 0.0000 247 | vt 0.1333 0.6000 0.0000 248 | vt 0.2000 0.6000 0.0000 249 | vt 0.2667 0.6000 0.0000 250 | vt 0.3333 0.6000 0.0000 251 | vt 0.4000 0.6000 0.0000 252 | vt 0.4667 0.6000 0.0000 253 | vt 0.5333 0.6000 0.0000 254 | vt 0.6000 0.6000 0.0000 255 | vt 0.6667 0.6000 0.0000 256 | vt 0.7333 0.6000 0.0000 257 | vt 0.8000 0.6000 0.0000 258 | vt 0.8667 0.6000 0.0000 259 | vt 0.9333 0.6000 0.0000 260 | vt 1.0000 0.6000 0.0000 261 | vt 0.0000 0.4667 0.0000 262 | vt 0.0667 0.4667 0.0000 263 | vt 0.1333 0.4667 0.0000 264 | vt 0.2000 0.4667 0.0000 265 | vt 0.2667 0.4667 0.0000 266 | vt 0.3333 0.4667 0.0000 267 | vt 0.4000 0.4667 0.0000 268 | vt 0.4667 0.4667 0.0000 269 | vt 0.5333 0.4667 0.0000 270 | vt 0.6000 0.4667 0.0000 271 | vt 0.6667 0.4667 0.0000 272 | vt 0.7333 0.4667 0.0000 273 | vt 0.8000 0.4667 0.0000 274 | vt 0.8667 0.4667 0.0000 275 | vt 0.9333 0.4667 0.0000 276 | vt 1.0000 0.4667 0.0000 277 | vt 0.0000 0.3333 0.0000 278 | vt 0.0667 0.3333 0.0000 279 | vt 0.1333 0.3333 0.0000 280 | vt 0.2000 0.3333 0.0000 281 | vt 0.2667 0.3333 0.0000 282 | vt 0.3333 0.3333 0.0000 283 | vt 0.4000 0.3333 0.0000 284 | vt 0.4667 0.3333 0.0000 285 | vt 0.5333 0.3333 0.0000 286 | vt 0.6000 0.3333 0.0000 287 | vt 0.6667 0.3333 0.0000 288 | vt 0.7333 0.3333 0.0000 289 | vt 0.8000 0.3333 0.0000 290 | vt 0.8667 0.3333 0.0000 291 | vt 0.9333 0.3333 0.0000 292 | vt 1.0000 0.3333 0.0000 293 | vt 0.0000 0.2000 0.0000 294 | vt 0.0667 0.2000 0.0000 295 | vt 0.1333 0.2000 0.0000 296 | vt 0.2000 0.2000 0.0000 297 | vt 0.2667 0.2000 0.0000 298 | vt 0.3333 0.2000 0.0000 299 | vt 0.4000 0.2000 0.0000 300 | vt 0.4667 0.2000 0.0000 301 | vt 0.5333 0.2000 0.0000 302 | vt 0.6000 0.2000 0.0000 303 | vt 0.6667 0.2000 0.0000 304 | vt 0.7333 0.2000 0.0000 305 | vt 0.8000 0.2000 0.0000 306 | vt 0.8667 0.2000 0.0000 307 | vt 0.9333 0.2000 0.0000 308 | vt 1.0000 0.2000 0.0000 309 | vt 0.0000 0.0667 0.0000 310 | vt 0.0667 0.0667 0.0000 311 | vt 0.1333 0.0667 0.0000 312 | vt 0.2000 0.0667 0.0000 313 | vt 0.2667 0.0667 0.0000 314 | vt 0.3333 0.0667 0.0000 315 | vt 0.4000 0.0667 0.0000 316 | vt 0.4667 0.0667 0.0000 317 | vt 0.5333 0.0667 0.0000 318 | vt 0.6000 0.0667 0.0000 319 | vt 0.6667 0.0667 0.0000 320 | vt 0.7333 0.0667 0.0000 321 | vt 0.8000 0.0667 0.0000 322 | vt 0.8667 0.0667 0.0000 323 | vt 0.9333 0.0667 0.0000 324 | # 126 texture coords 325 | 326 | g Sphere01 327 | usemtl wire_166229229 328 | s 1 329 | f 1/1/1 2/2/2 3/3/3 330 | f 1/4/1 3/3/3 4/5/4 331 | f 1/6/1 4/5/4 5/7/5 332 | f 1/8/1 5/7/5 6/9/6 333 | f 1/10/1 6/9/6 7/11/7 334 | f 1/12/1 7/11/7 8/13/8 335 | f 1/14/1 8/13/8 9/15/9 336 | f 1/16/1 9/15/9 10/17/10 337 | f 1/18/1 10/17/10 11/19/11 338 | f 1/20/1 11/19/11 12/21/12 339 | f 1/22/1 12/21/12 13/23/13 340 | f 1/24/1 13/23/13 14/25/14 341 | f 1/26/1 14/25/14 15/27/15 342 | f 1/28/1 15/27/15 16/29/16 343 | f 1/30/1 16/29/16 2/31/2 344 | f 2/2/2 17/32/17 18/33/18 345 | f 2/2/2 18/33/18 3/3/3 346 | f 3/3/3 18/33/18 19/34/19 347 | f 3/3/3 19/34/19 4/5/4 348 | f 4/5/4 19/34/19 20/35/20 349 | f 4/5/4 20/35/20 5/7/5 350 | f 5/7/5 20/35/20 21/36/21 351 | f 5/7/5 21/36/21 6/9/6 352 | f 6/9/6 21/36/21 22/37/22 353 | f 6/9/6 22/37/22 7/11/7 354 | f 7/11/7 22/37/22 23/38/23 355 | f 7/11/7 23/38/23 8/13/8 356 | f 8/13/8 23/38/23 24/39/24 357 | f 8/13/8 24/39/24 9/15/9 358 | f 9/15/9 24/39/24 25/40/25 359 | f 9/15/9 25/40/25 10/17/10 360 | f 10/17/10 25/40/25 26/41/26 361 | f 10/17/10 26/41/26 11/19/11 362 | f 11/19/11 26/41/26 27/42/27 363 | f 11/19/11 27/42/27 12/21/12 364 | f 12/21/12 27/42/27 28/43/28 365 | f 12/21/12 28/43/28 13/23/13 366 | f 13/23/13 28/43/28 29/44/29 367 | f 13/23/13 29/44/29 14/25/14 368 | f 14/25/14 29/44/29 30/45/30 369 | f 14/25/14 30/45/30 15/27/15 370 | f 15/27/15 30/45/30 31/46/31 371 | f 15/27/15 31/46/31 16/29/16 372 | f 16/29/16 31/46/31 17/47/17 373 | f 16/29/16 17/47/17 2/31/2 374 | f 17/32/17 32/48/32 33/49/33 375 | f 17/32/17 33/49/33 18/33/18 376 | f 18/33/18 33/49/33 34/50/34 377 | f 18/33/18 34/50/34 19/34/19 378 | f 19/34/19 34/50/34 35/51/35 379 | f 19/34/19 35/51/35 20/35/20 380 | f 20/35/20 35/51/35 36/52/36 381 | f 20/35/20 36/52/36 21/36/21 382 | f 21/36/21 36/52/36 37/53/37 383 | f 21/36/21 37/53/37 22/37/22 384 | f 22/37/22 37/53/37 38/54/38 385 | f 22/37/22 38/54/38 23/38/23 386 | f 23/38/23 38/54/38 39/55/39 387 | f 23/38/23 39/55/39 24/39/24 388 | f 24/39/24 39/55/39 40/56/40 389 | f 24/39/24 40/56/40 25/40/25 390 | f 25/40/25 40/56/40 41/57/41 391 | f 25/40/25 41/57/41 26/41/26 392 | f 26/41/26 41/57/41 42/58/42 393 | f 26/41/26 42/58/42 27/42/27 394 | f 27/42/27 42/58/42 43/59/43 395 | f 27/42/27 43/59/43 28/43/28 396 | f 28/43/28 43/59/43 44/60/44 397 | f 28/43/28 44/60/44 29/44/29 398 | f 29/44/29 44/60/44 45/61/45 399 | f 29/44/29 45/61/45 30/45/30 400 | f 30/45/30 45/61/45 46/62/46 401 | f 30/45/30 46/62/46 31/46/31 402 | f 31/46/31 46/62/46 32/63/32 403 | f 31/46/31 32/63/32 17/47/17 404 | f 32/48/32 47/64/47 48/65/48 405 | f 32/48/32 48/65/48 33/49/33 406 | f 33/49/33 48/65/48 49/66/49 407 | f 33/49/33 49/66/49 34/50/34 408 | f 34/50/34 49/66/49 50/67/50 409 | f 34/50/34 50/67/50 35/51/35 410 | f 35/51/35 50/67/50 51/68/51 411 | f 35/51/35 51/68/51 36/52/36 412 | f 36/52/36 51/68/51 52/69/52 413 | f 36/52/36 52/69/52 37/53/37 414 | f 37/53/37 52/69/52 53/70/53 415 | f 37/53/37 53/70/53 38/54/38 416 | f 38/54/38 53/70/53 54/71/54 417 | f 38/54/38 54/71/54 39/55/39 418 | f 39/55/39 54/71/54 55/72/55 419 | f 39/55/39 55/72/55 40/56/40 420 | f 40/56/40 55/72/55 56/73/56 421 | f 40/56/40 56/73/56 41/57/41 422 | f 41/57/41 56/73/56 57/74/57 423 | f 41/57/41 57/74/57 42/58/42 424 | f 42/58/42 57/74/57 58/75/58 425 | f 42/58/42 58/75/58 43/59/43 426 | f 43/59/43 58/75/58 59/76/59 427 | f 43/59/43 59/76/59 44/60/44 428 | f 44/60/44 59/76/59 60/77/60 429 | f 44/60/44 60/77/60 45/61/45 430 | f 45/61/45 60/77/60 61/78/61 431 | f 45/61/45 61/78/61 46/62/46 432 | f 46/62/46 61/78/61 47/79/47 433 | f 46/62/46 47/79/47 32/63/32 434 | f 47/64/47 62/80/62 63/81/63 435 | f 47/64/47 63/81/63 48/65/48 436 | f 48/65/48 63/81/63 64/82/64 437 | f 48/65/48 64/82/64 49/66/49 438 | f 49/66/49 64/82/64 65/83/65 439 | f 49/66/49 65/83/65 50/67/50 440 | f 50/67/50 65/83/65 66/84/66 441 | f 50/67/50 66/84/66 51/68/51 442 | f 51/68/51 66/84/66 67/85/67 443 | f 51/68/51 67/85/67 52/69/52 444 | f 52/69/52 67/85/67 68/86/68 445 | f 52/69/52 68/86/68 53/70/53 446 | f 53/70/53 68/86/68 69/87/69 447 | f 53/70/53 69/87/69 54/71/54 448 | f 54/71/54 69/87/69 70/88/70 449 | f 54/71/54 70/88/70 55/72/55 450 | f 55/72/55 70/88/70 71/89/71 451 | f 55/72/55 71/89/71 56/73/56 452 | f 56/73/56 71/89/71 72/90/72 453 | f 56/73/56 72/90/72 57/74/57 454 | f 57/74/57 72/90/72 73/91/73 455 | f 57/74/57 73/91/73 58/75/58 456 | f 58/75/58 73/91/73 74/92/74 457 | f 58/75/58 74/92/74 59/76/59 458 | f 59/76/59 74/92/74 75/93/75 459 | f 59/76/59 75/93/75 60/77/60 460 | f 60/77/60 75/93/75 76/94/76 461 | f 60/77/60 76/94/76 61/78/61 462 | f 61/78/61 76/94/76 62/95/62 463 | f 61/78/61 62/95/62 47/79/47 464 | f 62/80/62 77/96/77 78/97/78 465 | f 62/80/62 78/97/78 63/81/63 466 | f 63/81/63 78/97/78 79/98/79 467 | f 63/81/63 79/98/79 64/82/64 468 | f 64/82/64 79/98/79 80/99/80 469 | f 64/82/64 80/99/80 65/83/65 470 | f 65/83/65 80/99/80 81/100/81 471 | f 65/83/65 81/100/81 66/84/66 472 | f 66/84/66 81/100/81 82/101/82 473 | f 66/84/66 82/101/82 67/85/67 474 | f 67/85/67 82/101/82 83/102/83 475 | f 67/85/67 83/102/83 68/86/68 476 | f 68/86/68 83/102/83 84/103/84 477 | f 68/86/68 84/103/84 69/87/69 478 | f 69/87/69 84/103/84 85/104/85 479 | f 69/87/69 85/104/85 70/88/70 480 | f 70/88/70 85/104/85 86/105/86 481 | f 70/88/70 86/105/86 71/89/71 482 | f 71/89/71 86/105/86 87/106/87 483 | f 71/89/71 87/106/87 72/90/72 484 | f 72/90/72 87/106/87 88/107/88 485 | f 72/90/72 88/107/88 73/91/73 486 | f 73/91/73 88/107/88 89/108/89 487 | f 73/91/73 89/108/89 74/92/74 488 | f 74/92/74 89/108/89 90/109/90 489 | f 74/92/74 90/109/90 75/93/75 490 | f 75/93/75 90/109/90 91/110/91 491 | f 75/93/75 91/110/91 76/94/76 492 | f 76/94/76 91/110/91 77/111/77 493 | f 76/94/76 77/111/77 62/95/62 494 | f 92/112/92 78/97/78 77/96/77 495 | f 92/113/92 79/98/79 78/97/78 496 | f 92/114/92 80/99/80 79/98/79 497 | f 92/115/92 81/100/81 80/99/80 498 | f 92/116/92 82/101/82 81/100/81 499 | f 92/117/92 83/102/83 82/101/82 500 | f 92/118/92 84/103/84 83/102/83 501 | f 92/119/92 85/104/85 84/103/84 502 | f 92/120/92 86/105/86 85/104/85 503 | f 92/121/92 87/106/87 86/105/86 504 | f 92/122/92 88/107/88 87/106/87 505 | f 92/123/92 89/108/89 88/107/88 506 | f 92/124/92 90/109/90 89/108/89 507 | f 92/125/92 91/110/91 90/109/90 508 | f 92/126/92 77/111/77 91/110/91 509 | # 180 faces 510 | 511 | -------------------------------------------------------------------------------- /data/obj/tank.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 26.12.2014 11:45:11 3 | 4 | newmtl 02___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5882 0.5882 0.5882 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka D:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\tank.obj.png 16 | map_Kd D:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\tank.obj.png 17 | -------------------------------------------------------------------------------- /data/obj/tank.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/tank.obj.png -------------------------------------------------------------------------------- /data/obj/tank.obj.png.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/tank.obj.png.jpg -------------------------------------------------------------------------------- /data/obj/untitled3.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 20.01.2015 20:58:37 3 | 4 | newmtl 01___Default 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.0000 0.0000 0.0000 12 | Kd 0.5882 0.5882 0.5882 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka d:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\untitled3.obj.png 16 | map_Kd d:\Software\@Development\@Phone\PythonWork\AtomPlatform\graphics\obj\untitled3.obj.png 17 | -------------------------------------------------------------------------------- /data/obj/untitled3.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/untitled3.obj.png -------------------------------------------------------------------------------- /data/obj/untitled3x.obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/data/obj/untitled3x.obj.png -------------------------------------------------------------------------------- /editor/editor_manager.py: -------------------------------------------------------------------------------- 1 | import math 2 | from textwrap import dedent 3 | from kivy3dgui.node import Node 4 | from kivy.lang import Builder 5 | from textwrap import dedent 6 | from kivy.properties import ObjectProperty, ListProperty 7 | 8 | MAX_QUEUE = 20 9 | 10 | class Command: 11 | obj = None 12 | def __init__(self, *args): 13 | pass 14 | def restore(self): 15 | pass 16 | 17 | 18 | class Move(Command): 19 | obj = None 20 | pos = [0, 0, 0] 21 | 22 | def __init__(self, *args): 23 | self.obj = args[0] 24 | self.pos = args[1] 25 | 26 | def restore(self): 27 | self.obj.translate = self.pos[:] 28 | 29 | class Rotate(Command): 30 | obj = None 31 | rot = [0, 0, 0] 32 | 33 | def __init__(self, *args): 34 | self.obj = args[0] 35 | self.rot = args[1] 36 | 37 | def restore(self): 38 | self.obj.pitch = self.rot[0] 39 | self.obj.yaw = self.rot[1] 40 | self.obj.roll = self.rot[2] 41 | 42 | 43 | class Scale(Command): 44 | obj = None 45 | scale = [0.01, 0.01, 0.01] 46 | 47 | def __init__(self, *args): 48 | self.obj = args[0] 49 | self.scale = args[1] 50 | 51 | def restore(self): 52 | self.obj.scale = self.scale[:] 53 | 54 | class Create(Command): 55 | obj = None 56 | layout = None 57 | 58 | def __init__(self, *args): 59 | self.obj = args[0] 60 | self.layout = args[1] 61 | 62 | def restore(self): 63 | self.layout.remove_widget(self.obj) 64 | 65 | class Remove(Command): 66 | obj = None 67 | c_dict = None 68 | layout = None 69 | callback = None 70 | 71 | def __init__(self, *args): 72 | self.obj = args[0] 73 | self.c_dict = { 74 | "translate": args[0].translate, 75 | "rotate": args[0].rotate, 76 | "pitch": args[0].pitch, 77 | "yaw": args[0].yaw, 78 | "roll": args[0].roll, 79 | "scale": args[0].scale, 80 | "meshes": args[0].meshes, 81 | "anims": args[0]._anims, 82 | "effect": args[0].effect, 83 | "current_anim_index": args[0].current_anim_index, 84 | "axis_type": args[0].axis_type, 85 | "light_intensity": args[0].light_intensity, 86 | "normal_map": args[0].normal_map, 87 | "alpha": args[0].alpha, 88 | "shadows_bias": args[0].shadows_bias 89 | } 90 | self.layout = args[1] 91 | self.callback = args[2] 92 | 93 | def restore(self, *args): 94 | 95 | node = Node(**self.c_dict) 96 | float = dedent(""" 97 | FloatLayout: 98 | Button: 99 | size_hint: (1., 1.) 100 | id: a_button""") 101 | selector = Builder.load_string(float) 102 | node.add_widget( selector ) 103 | for e in args[0][:-1]: 104 | if e.obj == self.obj: 105 | e.obj = node 106 | self.callback(node, node.translate, node.scale, selector.ids.a_button, [node.pitch, node.yaw, node.roll]) 107 | #self.layout.add_widget(node) 108 | 109 | 110 | class EditorManager: 111 | commands = [] 112 | editor = None 113 | def __init__(self, editor): 114 | self.editor = editor 115 | self.commands = [] 116 | pass 117 | 118 | def add_command(self, command): 119 | self.commands.append(command) 120 | 121 | def restore(self): 122 | if self.commands: 123 | 124 | self.editor.space_editor.node_helper.current_mesh = None 125 | self.editor.space_editor.node_helper.move_to([100000, 100000, 100000]) 126 | if isinstance(self.commands[-1], Remove): 127 | self.commands[-1].restore(self.commands) 128 | else: 129 | self.commands[-1].restore() 130 | if len(self.commands) == 1: 131 | self.commands = [] 132 | else: 133 | self.commands = self.commands[0: -1] 134 | 135 | #print(self.commands) -------------------------------------------------------------------------------- /editor/images/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/editor/images/blue.png -------------------------------------------------------------------------------- /editor/images/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/editor/images/green.png -------------------------------------------------------------------------------- /editor/images/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/editor/images/normal.png -------------------------------------------------------------------------------- /editor/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/editor/images/red.png -------------------------------------------------------------------------------- /editor/meshes/x-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 15.11.2017 22:34:18 3 | 4 | mtllib x-axis.mtl 5 | 6 | # 7 | o x_axis 8 | # 9 | 10 | v 79.7760 -0.4417 3.1093 11 | v 79.7760 7.6959 -5.0283 12 | v 79.7760 -0.4417 -8.3990 13 | v 79.7760 11.0666 3.1093 14 | v 79.7760 7.6959 11.2469 15 | v 79.7760 -0.4417 14.6176 16 | v 79.7760 -8.5793 11.2469 17 | v 79.7760 -11.9501 3.1093 18 | v 79.7760 -8.5793 -5.0283 19 | v 100.3627 -0.4417 3.1093 20 | v 79.7149 -1.1736 3.6395 21 | v -3.6031 -1.1736 3.6395 22 | v -3.6031 -1.1736 1.8124 23 | v 79.7149 -1.1736 1.8124 24 | v 79.7149 0.2881 3.6395 25 | v 79.7149 0.2881 1.8124 26 | v -3.6031 0.2881 1.8124 27 | v -3.6031 0.2881 3.6395 28 | # 18 vertices 29 | 30 | vn -1.0000 0.0000 0.0000 31 | vn 0.4880 -0.0000 -0.8729 32 | vn 0.4589 0.3400 -0.8209 33 | vn 0.4589 -0.3400 -0.8209 34 | vn 0.4880 0.6172 -0.6172 35 | vn 0.4589 0.8209 -0.3400 36 | vn 0.4880 0.8729 0.0000 37 | vn 0.4589 0.8209 0.3400 38 | vn 0.4880 0.6172 0.6172 39 | vn 0.4589 0.3400 0.8209 40 | vn 0.4880 -0.0000 0.8729 41 | vn 0.4589 -0.3400 0.8209 42 | vn 0.4879 -0.6172 0.6172 43 | vn 0.4589 -0.8209 0.3400 44 | vn 0.4879 -0.8729 -0.0000 45 | vn 0.4589 -0.8209 -0.3400 46 | vn 0.4879 -0.6172 -0.6172 47 | vn -0.0000 0.0000 -1.0000 48 | vn 0.0000 -1.0000 -0.0000 49 | vn 0.0000 1.0000 -0.0000 50 | vn 1.0000 -0.0000 -0.0000 51 | vn 0.0000 0.0000 1.0000 52 | # 22 vertex normals 53 | 54 | vt 0.5000 0.5000 0.8020 55 | vt 0.8536 0.8536 0.8020 56 | vt 1.0000 0.5000 0.8020 57 | vt 0.5000 1.0000 0.8020 58 | vt 0.1464 0.8536 0.8020 59 | vt 0.0000 0.5000 0.8020 60 | vt 0.1464 0.1464 0.8020 61 | vt 0.5000 0.0000 0.8020 62 | vt 0.8536 0.1464 0.8020 63 | vt 0.5000 0.5000 1.0000 64 | vt 0.4770 0.4682 0.8014 65 | vt 0.4770 0.4682 0.0000 66 | vt 0.5563 0.4682 0.0000 67 | vt 0.5563 0.4682 0.8014 68 | vt 0.4770 0.5317 0.8014 69 | vt 0.5563 0.5317 0.8014 70 | vt 0.5563 0.5317 0.0000 71 | vt 0.4770 0.5317 0.0000 72 | # 18 texture coords 73 | 74 | g x_axis 75 | usemtl wire_085028177 76 | s 1 77 | f 1/1/1 2/2/1 3/3/1 78 | f 1/1/1 4/4/1 2/2/1 79 | f 1/1/1 5/5/1 4/4/1 80 | f 1/1/1 6/6/1 5/5/1 81 | f 1/1/1 7/7/1 6/6/1 82 | f 1/1/1 8/8/1 7/7/1 83 | f 1/1/1 9/9/1 8/8/1 84 | f 1/1/1 3/3/1 9/9/1 85 | s 8 86 | f 3/3/2 10/10/3 10/10/4 87 | f 3/3/2 2/2/5 10/10/3 88 | f 2/2/5 10/10/6 10/10/3 89 | f 2/2/5 4/4/7 10/10/6 90 | f 4/4/7 10/10/8 10/10/6 91 | f 4/4/7 5/5/9 10/10/8 92 | f 5/5/9 10/10/10 10/10/8 93 | f 5/5/9 6/6/11 10/10/10 94 | f 6/6/11 10/10/12 10/10/10 95 | f 6/6/11 7/7/13 10/10/12 96 | f 7/7/13 10/10/14 10/10/12 97 | f 7/7/13 8/8/15 10/10/14 98 | f 8/8/15 10/10/16 10/10/14 99 | f 8/8/15 9/9/17 10/10/16 100 | f 9/9/17 10/10/4 10/10/16 101 | f 9/9/17 3/3/2 10/10/4 102 | s 1 103 | f 10/10/18 10/10/18 10/10/18 104 | f 10/10/18 10/10/18 10/10/18 105 | f 10/10/18 10/10/18 10/10/18 106 | f 10/10/18 10/10/18 10/10/18 107 | f 10/10/18 10/10/18 10/10/18 108 | f 10/10/18 10/10/18 10/10/18 109 | f 10/10/18 10/10/18 10/10/18 110 | f 10/10/18 10/10/18 10/10/18 111 | s 2 112 | f 11/11/19 12/12/19 13/13/19 113 | f 13/13/19 14/14/19 11/11/19 114 | s 4 115 | f 15/15/20 16/16/20 17/17/20 116 | f 17/17/20 18/18/20 15/15/20 117 | s 8 118 | f 11/11/21 14/14/21 16/16/21 119 | f 16/16/21 15/15/21 11/11/21 120 | s 16 121 | f 14/14/18 13/13/18 17/17/18 122 | f 17/17/18 16/16/18 14/14/18 123 | s 32 124 | f 13/13/1 12/12/1 18/18/1 125 | f 18/18/1 17/17/1 13/13/1 126 | s 64 127 | f 12/12/22 11/11/22 15/15/22 128 | f 15/15/22 18/18/22 12/12/22 129 | # 44 faces 130 | 131 | -------------------------------------------------------------------------------- /editor/meshes/x-rot-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 17.11.2017 14:30:16 3 | 4 | mtllib x-rot-axis.mtl 5 | 6 | # 7 | o x_rot_axis 8 | # 9 | 10 | v -5.0152 50.7050 2.1358 11 | v -2.0152 47.6896 -14.9652 12 | v -5.0152 47.6896 -14.9652 13 | v -2.0152 50.7050 2.1358 14 | v -2.0152 42.9912 -13.2551 15 | v -2.0152 45.7050 2.1358 16 | v -5.0152 42.9912 -13.2551 17 | v -5.0152 45.7050 2.1358 18 | v -2.0152 39.0072 -30.0036 19 | v -5.0152 39.0072 -30.0036 20 | v -2.0152 35.1770 -26.7897 21 | v -5.0152 35.1770 -26.7897 22 | v -2.0152 25.7050 -41.1655 23 | v -5.0152 25.7050 -41.1655 24 | v -2.0152 23.2050 -36.8354 25 | v -5.0152 23.2050 -36.8354 26 | v -2.0152 9.3874 -47.1046 27 | v -5.0152 9.3874 -47.1046 28 | v -2.0152 8.5192 -42.1806 29 | v -5.0152 8.5192 -42.1806 30 | v -2.0152 -7.9774 -47.1046 31 | v -5.0152 -7.9774 -47.1046 32 | v -2.0152 -7.1092 -42.1806 33 | v -5.0152 -7.1092 -42.1806 34 | v -2.0152 -24.2950 -41.1655 35 | v -5.0152 -24.2950 -41.1655 36 | v -2.0152 -21.7950 -36.8354 37 | v -5.0152 -21.7950 -36.8354 38 | v -2.0152 -37.5972 -30.0036 39 | v -5.0152 -37.5972 -30.0036 40 | v -2.0152 -33.7670 -26.7896 41 | v -5.0152 -33.7670 -26.7896 42 | v -2.0152 -46.2796 -14.9652 43 | v -5.0152 -46.2796 -14.9652 44 | v -2.0152 -41.5812 -13.2551 45 | v -5.0152 -41.5812 -13.2551 46 | v -2.0152 -49.2950 2.1358 47 | v -5.0152 -49.2950 2.1358 48 | v -2.0152 -44.2950 2.1358 49 | v -5.0152 -44.2950 2.1358 50 | v -2.0152 -46.2796 19.2368 51 | v -5.0152 -46.2796 19.2368 52 | v -2.0152 -41.5812 17.5267 53 | v -5.0152 -41.5812 17.5267 54 | v -2.0152 -37.5972 34.2752 55 | v -5.0152 -37.5972 34.2752 56 | v -2.0152 -33.7670 31.0612 57 | v -5.0152 -33.7670 31.0612 58 | v -2.0152 -24.2950 45.4371 59 | v -5.0152 -24.2950 45.4371 60 | v -2.0152 -21.7950 41.1069 61 | v -5.0152 -21.7950 41.1069 62 | v -2.0152 -7.9774 51.3762 63 | v -5.0152 -7.9774 51.3762 64 | v -2.0152 -7.1092 46.4521 65 | v -5.0152 -7.1092 46.4521 66 | v -2.0152 9.3874 51.3762 67 | v -5.0152 9.3874 51.3762 68 | v -2.0152 8.5192 46.4521 69 | v -5.0152 8.5192 46.4521 70 | v -2.0152 25.7050 45.4371 71 | v -5.0152 25.7050 45.4371 72 | v -2.0152 23.2050 41.1069 73 | v -5.0152 23.2050 41.1069 74 | v -2.0152 39.0072 34.2752 75 | v -5.0152 39.0072 34.2752 76 | v -2.0152 35.1770 31.0612 77 | v -5.0152 35.1770 31.0612 78 | v -2.0152 47.6896 19.2368 79 | v -5.0152 47.6896 19.2368 80 | v -2.0152 42.9912 17.5267 81 | v -5.0152 42.9912 17.5267 82 | # 72 vertices 83 | 84 | vn 0.0000 1.0000 -0.0000 85 | vn 0.0000 0.9397 -0.3420 86 | vn 1.0000 -0.0000 -0.0000 87 | vn -0.0000 -1.0000 0.0000 88 | vn -0.0000 -0.9397 0.3420 89 | vn -1.0000 0.0000 0.0000 90 | vn 0.0000 0.7660 -0.6428 91 | vn -0.0000 -0.7660 0.6428 92 | vn -0.0000 0.5000 -0.8660 93 | vn 0.0000 -0.5000 0.8660 94 | vn -0.0000 0.1736 -0.9848 95 | vn 0.0000 -0.1736 0.9848 96 | vn -0.0000 -0.1736 -0.9848 97 | vn 0.0000 0.1736 0.9848 98 | vn -0.0000 -0.5000 -0.8660 99 | vn 0.0000 0.5000 0.8660 100 | vn -0.0000 -0.7660 -0.6428 101 | vn 0.0000 0.7660 0.6428 102 | vn -0.0000 -0.9397 -0.3420 103 | vn 0.0000 0.9397 0.3420 104 | # 20 vertex normals 105 | 106 | vt 0.0000 0.0000 0.0000 107 | vt 0.2500 0.0556 0.0000 108 | vt 0.0000 0.0556 0.0000 109 | vt 0.2500 0.0000 0.0000 110 | vt 0.5000 0.0556 0.0000 111 | vt 0.5000 0.0000 0.0000 112 | vt 0.7500 0.0556 0.0000 113 | vt 0.7500 0.0000 0.0000 114 | vt 1.0000 0.0556 0.0000 115 | vt 1.0000 0.0000 0.0000 116 | vt 0.2500 0.1111 0.0000 117 | vt 0.0000 0.1111 0.0000 118 | vt 0.5000 0.1111 0.0000 119 | vt 0.7500 0.1111 0.0000 120 | vt 1.0000 0.1111 0.0000 121 | vt 0.2500 0.1667 0.0000 122 | vt 0.0000 0.1667 0.0000 123 | vt 0.5000 0.1667 0.0000 124 | vt 0.7500 0.1667 0.0000 125 | vt 1.0000 0.1667 0.0000 126 | vt 0.2500 0.2222 0.0000 127 | vt 0.0000 0.2222 0.0000 128 | vt 0.5000 0.2222 0.0000 129 | vt 0.7500 0.2222 0.0000 130 | vt 1.0000 0.2222 0.0000 131 | vt 0.2500 0.2778 0.0000 132 | vt 0.0000 0.2778 0.0000 133 | vt 0.5000 0.2778 0.0000 134 | vt 0.7500 0.2778 0.0000 135 | vt 1.0000 0.2778 0.0000 136 | vt 0.2500 0.3333 0.0000 137 | vt 0.0000 0.3333 0.0000 138 | vt 0.5000 0.3333 0.0000 139 | vt 0.7500 0.3333 0.0000 140 | vt 1.0000 0.3333 0.0000 141 | vt 0.2500 0.3889 0.0000 142 | vt 0.0000 0.3889 0.0000 143 | vt 0.5000 0.3889 0.0000 144 | vt 0.7500 0.3889 0.0000 145 | vt 1.0000 0.3889 0.0000 146 | vt 0.2500 0.4444 0.0000 147 | vt 0.0000 0.4444 0.0000 148 | vt 0.5000 0.4444 0.0000 149 | vt 0.7500 0.4444 0.0000 150 | vt 1.0000 0.4444 0.0000 151 | vt 0.2500 0.5000 0.0000 152 | vt 0.0000 0.5000 0.0000 153 | vt 0.5000 0.5000 0.0000 154 | vt 0.7500 0.5000 0.0000 155 | vt 1.0000 0.5000 0.0000 156 | vt 0.2500 0.5556 0.0000 157 | vt 0.0000 0.5556 0.0000 158 | vt 0.5000 0.5556 0.0000 159 | vt 0.7500 0.5556 0.0000 160 | vt 1.0000 0.5556 0.0000 161 | vt 0.2500 0.6111 0.0000 162 | vt 0.0000 0.6111 0.0000 163 | vt 0.5000 0.6111 0.0000 164 | vt 0.7500 0.6111 0.0000 165 | vt 1.0000 0.6111 0.0000 166 | vt 0.2500 0.6667 0.0000 167 | vt 0.0000 0.6667 0.0000 168 | vt 0.5000 0.6667 0.0000 169 | vt 0.7500 0.6667 0.0000 170 | vt 1.0000 0.6667 0.0000 171 | vt 0.2500 0.7222 0.0000 172 | vt 0.0000 0.7222 0.0000 173 | vt 0.5000 0.7222 0.0000 174 | vt 0.7500 0.7222 0.0000 175 | vt 1.0000 0.7222 0.0000 176 | vt 0.2500 0.7778 0.0000 177 | vt 0.0000 0.7778 0.0000 178 | vt 0.5000 0.7778 0.0000 179 | vt 0.7500 0.7778 0.0000 180 | vt 1.0000 0.7778 0.0000 181 | vt 0.2500 0.8333 0.0000 182 | vt 0.0000 0.8333 0.0000 183 | vt 0.5000 0.8333 0.0000 184 | vt 0.7500 0.8333 0.0000 185 | vt 1.0000 0.8333 0.0000 186 | vt 0.2500 0.8889 0.0000 187 | vt 0.0000 0.8889 0.0000 188 | vt 0.5000 0.8889 0.0000 189 | vt 0.7500 0.8889 0.0000 190 | vt 1.0000 0.8889 0.0000 191 | vt 0.2500 0.9444 0.0000 192 | vt 0.0000 0.9444 0.0000 193 | vt 0.5000 0.9444 0.0000 194 | vt 0.7500 0.9444 0.0000 195 | vt 1.0000 0.9444 0.0000 196 | vt 0.2500 1.0000 0.0000 197 | vt 0.0000 1.0000 0.0000 198 | vt 0.5000 1.0000 0.0000 199 | vt 0.7500 1.0000 0.0000 200 | vt 1.0000 1.0000 0.0000 201 | # 95 texture coords 202 | 203 | g x_rot_axis 204 | usemtl 01___Default 205 | s 2 206 | f 1/1/1 2/2/2 3/3/2 207 | f 1/1/1 4/4/1 2/2/2 208 | s 4 209 | f 4/4/3 5/5/3 2/2/3 210 | f 4/4/3 6/6/3 5/5/3 211 | s 2 212 | f 6/6/4 7/7/5 5/5/5 213 | f 6/6/4 8/8/4 7/7/5 214 | s 4 215 | f 8/8/6 3/9/6 7/7/6 216 | f 8/8/6 1/10/6 3/9/6 217 | s 2 218 | f 3/3/2 9/11/7 10/12/7 219 | f 3/3/2 2/2/2 9/11/7 220 | s 4 221 | f 2/2/3 11/13/3 9/11/3 222 | f 2/2/3 5/5/3 11/13/3 223 | s 2 224 | f 5/5/5 12/14/8 11/13/8 225 | f 5/5/5 7/7/5 12/14/8 226 | s 4 227 | f 7/7/6 10/15/6 12/14/6 228 | f 7/7/6 3/9/6 10/15/6 229 | s 2 230 | f 10/12/7 13/16/9 14/17/9 231 | f 10/12/7 9/11/7 13/16/9 232 | s 4 233 | f 9/11/3 15/18/3 13/16/3 234 | f 9/11/3 11/13/3 15/18/3 235 | s 2 236 | f 11/13/8 16/19/10 15/18/10 237 | f 11/13/8 12/14/8 16/19/10 238 | s 4 239 | f 12/14/6 14/20/6 16/19/6 240 | f 12/14/6 10/15/6 14/20/6 241 | s 2 242 | f 14/17/9 17/21/11 18/22/11 243 | f 14/17/9 13/16/9 17/21/11 244 | s 4 245 | f 13/16/3 19/23/3 17/21/3 246 | f 13/16/3 15/18/3 19/23/3 247 | s 2 248 | f 15/18/10 20/24/12 19/23/12 249 | f 15/18/10 16/19/10 20/24/12 250 | s 4 251 | f 16/19/6 18/25/6 20/24/6 252 | f 16/19/6 14/20/6 18/25/6 253 | s 2 254 | f 18/22/11 21/26/13 22/27/13 255 | f 18/22/11 17/21/11 21/26/13 256 | s 4 257 | f 17/21/3 23/28/3 21/26/3 258 | f 17/21/3 19/23/3 23/28/3 259 | s 2 260 | f 19/23/12 24/29/14 23/28/14 261 | f 19/23/12 20/24/12 24/29/14 262 | s 4 263 | f 20/24/6 22/30/6 24/29/6 264 | f 20/24/6 18/25/6 22/30/6 265 | s 2 266 | f 22/27/13 25/31/15 26/32/15 267 | f 22/27/13 21/26/13 25/31/15 268 | s 4 269 | f 21/26/3 27/33/3 25/31/3 270 | f 21/26/3 23/28/3 27/33/3 271 | s 2 272 | f 23/28/14 28/34/16 27/33/16 273 | f 23/28/14 24/29/14 28/34/16 274 | s 4 275 | f 24/29/6 26/35/6 28/34/6 276 | f 24/29/6 22/30/6 26/35/6 277 | s 2 278 | f 26/32/15 29/36/17 30/37/17 279 | f 26/32/15 25/31/15 29/36/17 280 | s 4 281 | f 25/31/3 31/38/3 29/36/3 282 | f 25/31/3 27/33/3 31/38/3 283 | s 2 284 | f 27/33/16 32/39/18 31/38/18 285 | f 27/33/16 28/34/16 32/39/18 286 | s 4 287 | f 28/34/6 30/40/6 32/39/6 288 | f 28/34/6 26/35/6 30/40/6 289 | s 2 290 | f 30/37/17 33/41/19 34/42/19 291 | f 30/37/17 29/36/17 33/41/19 292 | s 4 293 | f 29/36/3 35/43/3 33/41/3 294 | f 29/36/3 31/38/3 35/43/3 295 | s 2 296 | f 31/38/18 36/44/20 35/43/20 297 | f 31/38/18 32/39/18 36/44/20 298 | s 4 299 | f 32/39/6 34/45/6 36/44/6 300 | f 32/39/6 30/40/6 34/45/6 301 | s 2 302 | f 34/42/19 37/46/4 38/47/4 303 | f 34/42/19 33/41/19 37/46/4 304 | s 4 305 | f 33/41/3 39/48/3 37/46/3 306 | f 33/41/3 35/43/3 39/48/3 307 | s 2 308 | f 35/43/20 40/49/1 39/48/1 309 | f 35/43/20 36/44/20 40/49/1 310 | s 4 311 | f 36/44/6 38/50/6 40/49/6 312 | f 36/44/6 34/45/6 38/50/6 313 | s 2 314 | f 38/47/4 41/51/5 42/52/5 315 | f 38/47/4 37/46/4 41/51/5 316 | s 4 317 | f 37/46/3 43/53/3 41/51/3 318 | f 37/46/3 39/48/3 43/53/3 319 | s 2 320 | f 39/48/1 44/54/2 43/53/2 321 | f 39/48/1 40/49/1 44/54/2 322 | s 4 323 | f 40/49/6 42/55/6 44/54/6 324 | f 40/49/6 38/50/6 42/55/6 325 | s 2 326 | f 42/52/5 45/56/8 46/57/8 327 | f 42/52/5 41/51/5 45/56/8 328 | s 4 329 | f 41/51/3 47/58/3 45/56/3 330 | f 41/51/3 43/53/3 47/58/3 331 | s 2 332 | f 43/53/2 48/59/7 47/58/7 333 | f 43/53/2 44/54/2 48/59/7 334 | s 4 335 | f 44/54/6 46/60/6 48/59/6 336 | f 44/54/6 42/55/6 46/60/6 337 | s 2 338 | f 46/57/8 49/61/10 50/62/10 339 | f 46/57/8 45/56/8 49/61/10 340 | s 4 341 | f 45/56/3 51/63/3 49/61/3 342 | f 45/56/3 47/58/3 51/63/3 343 | s 2 344 | f 47/58/7 52/64/9 51/63/9 345 | f 47/58/7 48/59/7 52/64/9 346 | s 4 347 | f 48/59/6 50/65/6 52/64/6 348 | f 48/59/6 46/60/6 50/65/6 349 | s 2 350 | f 50/62/10 53/66/12 54/67/12 351 | f 50/62/10 49/61/10 53/66/12 352 | s 4 353 | f 49/61/3 55/68/3 53/66/3 354 | f 49/61/3 51/63/3 55/68/3 355 | s 2 356 | f 51/63/9 56/69/11 55/68/11 357 | f 51/63/9 52/64/9 56/69/11 358 | s 4 359 | f 52/64/6 54/70/6 56/69/6 360 | f 52/64/6 50/65/6 54/70/6 361 | s 2 362 | f 54/67/12 57/71/14 58/72/14 363 | f 54/67/12 53/66/12 57/71/14 364 | s 4 365 | f 53/66/3 59/73/3 57/71/3 366 | f 53/66/3 55/68/3 59/73/3 367 | s 2 368 | f 55/68/11 60/74/13 59/73/13 369 | f 55/68/11 56/69/11 60/74/13 370 | s 4 371 | f 56/69/6 58/75/6 60/74/6 372 | f 56/69/6 54/70/6 58/75/6 373 | s 2 374 | f 58/72/14 61/76/16 62/77/16 375 | f 58/72/14 57/71/14 61/76/16 376 | s 4 377 | f 57/71/3 63/78/3 61/76/3 378 | f 57/71/3 59/73/3 63/78/3 379 | s 2 380 | f 59/73/13 64/79/15 63/78/15 381 | f 59/73/13 60/74/13 64/79/15 382 | s 4 383 | f 60/74/6 62/80/6 64/79/6 384 | f 60/74/6 58/75/6 62/80/6 385 | s 2 386 | f 62/77/16 65/81/18 66/82/18 387 | f 62/77/16 61/76/16 65/81/18 388 | s 4 389 | f 61/76/3 67/83/3 65/81/3 390 | f 61/76/3 63/78/3 67/83/3 391 | s 2 392 | f 63/78/15 68/84/17 67/83/17 393 | f 63/78/15 64/79/15 68/84/17 394 | s 4 395 | f 64/79/6 66/85/6 68/84/6 396 | f 64/79/6 62/80/6 66/85/6 397 | s 2 398 | f 66/82/18 69/86/20 70/87/20 399 | f 66/82/18 65/81/18 69/86/20 400 | s 4 401 | f 65/81/3 71/88/3 69/86/3 402 | f 65/81/3 67/83/3 71/88/3 403 | s 2 404 | f 67/83/17 72/89/19 71/88/19 405 | f 67/83/17 68/84/17 72/89/19 406 | s 4 407 | f 68/84/6 70/90/6 72/89/6 408 | f 68/84/6 66/85/6 70/90/6 409 | s 2 410 | f 70/87/20 4/91/1 1/92/1 411 | f 70/87/20 69/86/20 4/91/1 412 | s 4 413 | f 69/86/3 6/93/3 4/91/3 414 | f 69/86/3 71/88/3 6/93/3 415 | s 2 416 | f 71/88/19 8/94/4 6/93/4 417 | f 71/88/19 72/89/19 8/94/4 418 | s 4 419 | f 72/89/6 1/95/6 8/94/6 420 | f 72/89/6 70/90/6 1/95/6 421 | # 144 faces 422 | 423 | -------------------------------------------------------------------------------- /editor/meshes/x-scale-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 20.11.2017 11:47:48 3 | 4 | mtllib x-scale-axis.mtl 5 | 6 | # 7 | o x_scale_axis 8 | # 9 | 10 | v 48.9747 -2.3861 3.4524 11 | v 48.9747 -1.8861 3.4524 12 | v 48.9747 -1.8861 3.9524 13 | v 48.9747 -2.3861 3.9524 14 | v -1.9578 -2.3861 3.4524 15 | v -1.9578 -2.3861 3.9524 16 | v -1.9578 -1.8861 3.9524 17 | v -1.9578 -1.8861 3.4524 18 | v 54.3052 -12.1791 -6.2104 19 | v 54.3052 7.8209 -6.2103 20 | v 54.3052 7.8209 13.7897 21 | v 54.3052 -12.1791 13.7896 22 | v 50.7492 -12.1791 -6.2104 23 | v 50.7492 -12.1791 13.7896 24 | v 50.7492 7.8209 13.7897 25 | v 50.7492 7.8209 -6.2103 26 | # 16 vertices 27 | 28 | vn 1.0000 0.0000 0.0000 29 | vn -1.0000 -0.0000 -0.0000 30 | vn 0.0000 -1.0000 -0.0000 31 | vn -0.0000 -0.0000 1.0000 32 | vn -0.0000 1.0000 0.0000 33 | vn 0.0000 0.0000 -1.0000 34 | # 6 vertex normals 35 | 36 | vt 0.0000 0.0000 0.0000 37 | vt 1.0000 0.0000 0.0000 38 | vt 1.0000 1.0000 0.0000 39 | vt 0.0000 1.0000 0.0000 40 | # 4 texture coords 41 | 42 | g x_scale_axis 43 | usemtl 01___Default 44 | s 2 45 | f 1/1/1 2/2/1 3/3/1 46 | f 3/3/1 4/4/1 1/1/1 47 | s 4 48 | f 5/1/2 6/2/2 7/3/2 49 | f 7/3/2 8/4/2 5/1/2 50 | s 8 51 | f 1/1/3 4/2/3 6/3/3 52 | f 6/3/3 5/4/3 1/1/3 53 | s 16 54 | f 4/1/4 3/2/4 7/3/4 55 | f 7/3/4 6/4/4 4/1/4 56 | s 32 57 | f 3/1/5 2/2/5 8/3/5 58 | f 8/3/5 7/4/5 3/1/5 59 | s 64 60 | f 2/1/6 1/2/6 5/3/6 61 | f 5/3/6 8/4/6 2/1/6 62 | s 2 63 | f 9/1/1 10/2/1 11/3/1 64 | f 11/3/1 12/4/1 9/1/1 65 | s 4 66 | f 13/1/2 14/2/2 15/3/2 67 | f 15/3/2 16/4/2 13/1/2 68 | s 8 69 | f 9/1/3 12/2/3 14/3/3 70 | f 14/3/3 13/4/3 9/1/3 71 | s 16 72 | f 12/1/4 11/2/4 15/3/4 73 | f 15/3/4 14/4/4 12/1/4 74 | s 32 75 | f 11/1/5 10/2/5 16/3/5 76 | f 16/3/5 15/4/5 11/1/5 77 | s 64 78 | f 10/1/6 9/2/6 13/3/6 79 | f 13/3/6 16/4/6 10/1/6 80 | # 24 faces 81 | 82 | -------------------------------------------------------------------------------- /editor/meshes/y-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 15.11.2017 22:40:03 3 | 4 | mtllib y-axis.mtl 5 | 6 | # 7 | o y_axis 8 | # 9 | 10 | v -3.4760 84.3985 2.3668 11 | v 4.6616 84.3985 10.5044 12 | v -3.4760 84.3985 13.8751 13 | v 8.0323 84.3985 2.3668 14 | v 4.6616 84.3985 -5.7708 15 | v -3.4760 84.3985 -9.1415 16 | v -11.6136 84.3985 -5.7708 17 | v -14.9843 84.3985 2.3668 18 | v -11.6136 84.3985 10.5044 19 | v -3.4760 104.9851 2.3668 20 | v -4.2079 84.3373 1.8366 21 | v -4.2079 1.0194 1.8366 22 | v -4.2079 1.0194 3.6637 23 | v -4.2079 84.3373 3.6637 24 | v -2.7462 84.3373 1.8366 25 | v -2.7462 84.3373 3.6637 26 | v -2.7462 1.0194 3.6637 27 | v -2.7462 1.0194 1.8366 28 | # 18 vertices 29 | 30 | vn -0.0000 -1.0000 -0.0000 31 | vn 0.0000 0.4879 0.8729 32 | vn 0.3400 0.4589 0.8209 33 | vn -0.3400 0.4589 0.8209 34 | vn 0.6172 0.4879 0.6172 35 | vn 0.8209 0.4589 0.3400 36 | vn 0.8729 0.4879 -0.0000 37 | vn 0.8209 0.4589 -0.3400 38 | vn 0.6172 0.4880 -0.6172 39 | vn 0.3400 0.4589 -0.8209 40 | vn -0.0000 0.4880 -0.8729 41 | vn -0.3400 0.4589 -0.8209 42 | vn -0.6172 0.4880 -0.6172 43 | vn -0.8209 0.4589 -0.3400 44 | vn -0.8729 0.4880 0.0000 45 | vn -0.8209 0.4589 0.3400 46 | vn -0.6172 0.4880 0.6172 47 | vn 0.0000 -0.0000 1.0000 48 | vn -1.0000 0.0000 0.0000 49 | vn 1.0000 -0.0000 -0.0000 50 | vn 0.0000 1.0000 0.0000 51 | vn -0.0000 0.0000 -1.0000 52 | # 22 vertex normals 53 | 54 | vt 0.5000 0.5000 0.8020 55 | vt 0.8536 0.8536 0.8020 56 | vt 1.0000 0.5000 0.8020 57 | vt 0.5000 1.0000 0.8020 58 | vt 0.1464 0.8536 0.8020 59 | vt 0.0000 0.5000 0.8020 60 | vt 0.1464 0.1464 0.8020 61 | vt 0.5000 0.0000 0.8020 62 | vt 0.8536 0.1464 0.8020 63 | vt 0.5000 0.5000 1.0000 64 | vt 0.4770 0.4682 0.8014 65 | vt 0.4770 0.4682 0.0000 66 | vt 0.5563 0.4682 0.0000 67 | vt 0.5563 0.4682 0.8014 68 | vt 0.4770 0.5317 0.8014 69 | vt 0.5563 0.5317 0.8014 70 | vt 0.5563 0.5317 0.0000 71 | vt 0.4770 0.5317 0.0000 72 | # 18 texture coords 73 | 74 | g y_axis 75 | usemtl wire_085028177 76 | s 1 77 | f 1/1/1 2/2/1 3/3/1 78 | f 1/1/1 4/4/1 2/2/1 79 | f 1/1/1 5/5/1 4/4/1 80 | f 1/1/1 6/6/1 5/5/1 81 | f 1/1/1 7/7/1 6/6/1 82 | f 1/1/1 8/8/1 7/7/1 83 | f 1/1/1 9/9/1 8/8/1 84 | f 1/1/1 3/3/1 9/9/1 85 | s 8 86 | f 3/3/2 10/10/3 10/10/4 87 | f 3/3/2 2/2/5 10/10/3 88 | f 2/2/5 10/10/6 10/10/3 89 | f 2/2/5 4/4/7 10/10/6 90 | f 4/4/7 10/10/8 10/10/6 91 | f 4/4/7 5/5/9 10/10/8 92 | f 5/5/9 10/10/10 10/10/8 93 | f 5/5/9 6/6/11 10/10/10 94 | f 6/6/11 10/10/12 10/10/10 95 | f 6/6/11 7/7/13 10/10/12 96 | f 7/7/13 10/10/14 10/10/12 97 | f 7/7/13 8/8/15 10/10/14 98 | f 8/8/15 10/10/16 10/10/14 99 | f 8/8/15 9/9/17 10/10/16 100 | f 9/9/17 10/10/4 10/10/16 101 | f 9/9/17 3/3/2 10/10/4 102 | s 1 103 | f 10/10/18 10/10/18 10/10/18 104 | f 10/10/18 10/10/18 10/10/18 105 | f 10/10/18 10/10/18 10/10/18 106 | f 10/10/18 10/10/18 10/10/18 107 | f 10/10/18 10/10/18 10/10/18 108 | f 10/10/18 10/10/18 10/10/18 109 | f 10/10/18 10/10/18 10/10/18 110 | f 10/10/18 10/10/18 10/10/18 111 | s 2 112 | f 11/11/19 12/12/19 13/13/19 113 | f 13/13/19 14/14/19 11/11/19 114 | s 4 115 | f 15/15/20 16/16/20 17/17/20 116 | f 17/17/20 18/18/20 15/15/20 117 | s 8 118 | f 11/11/21 14/14/21 16/16/21 119 | f 16/16/21 15/15/21 11/11/21 120 | s 16 121 | f 14/14/18 13/13/18 17/17/18 122 | f 17/17/18 16/16/18 14/14/18 123 | s 32 124 | f 13/13/1 12/12/1 18/18/1 125 | f 18/18/1 17/17/1 13/13/1 126 | s 64 127 | f 12/12/22 11/11/22 15/15/22 128 | f 15/15/22 18/18/22 12/12/22 129 | # 44 faces 130 | 131 | -------------------------------------------------------------------------------- /editor/meshes/y-rot-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 17.11.2017 14:30:24 3 | 4 | mtllib y-rot-axis.mtl 5 | 6 | # 7 | o y_rot_axis 8 | # 9 | 10 | v -3.7805 0.0000 -47.8642 11 | v 13.3205 3.0000 -44.8488 12 | v 13.3205 0.0000 -44.8488 13 | v -3.7805 3.0000 -47.8642 14 | v 11.6104 3.0000 -40.1504 15 | v -3.7805 3.0000 -42.8642 16 | v 11.6104 0.0000 -40.1504 17 | v -3.7805 0.0000 -42.8642 18 | v 28.3589 3.0000 -36.1664 19 | v 28.3589 0.0000 -36.1664 20 | v 25.1449 3.0000 -32.3362 21 | v 25.1449 0.0000 -32.3362 22 | v 39.5208 3.0000 -22.8642 23 | v 39.5208 0.0000 -22.8642 24 | v 35.1906 3.0000 -20.3642 25 | v 35.1906 0.0000 -20.3642 26 | v 45.4599 3.0000 -6.5466 27 | v 45.4599 0.0000 -6.5466 28 | v 40.5358 3.0000 -5.6784 29 | v 40.5358 0.0000 -5.6784 30 | v 45.4599 3.0000 10.8182 31 | v 45.4599 0.0000 10.8182 32 | v 40.5358 3.0000 9.9500 33 | v 40.5358 0.0000 9.9500 34 | v 39.5208 3.0000 27.1358 35 | v 39.5208 0.0000 27.1358 36 | v 35.1906 3.0000 24.6358 37 | v 35.1906 0.0000 24.6358 38 | v 28.3589 3.0000 40.4380 39 | v 28.3589 0.0000 40.4380 40 | v 25.1449 3.0000 36.6078 41 | v 25.1449 0.0000 36.6078 42 | v 13.3205 3.0000 49.1204 43 | v 13.3205 0.0000 49.1204 44 | v 11.6104 3.0000 44.4220 45 | v 11.6104 0.0000 44.4220 46 | v -3.7805 3.0000 52.1358 47 | v -3.7805 0.0000 52.1358 48 | v -3.7805 3.0000 47.1358 49 | v -3.7805 0.0000 47.1358 50 | v -20.8815 3.0000 49.1204 51 | v -20.8815 0.0000 49.1204 52 | v -19.1714 3.0000 44.4219 53 | v -19.1714 0.0000 44.4219 54 | v -35.9199 3.0000 40.4380 55 | v -35.9199 0.0000 40.4380 56 | v -32.7060 3.0000 36.6078 57 | v -32.7060 0.0000 36.6078 58 | v -47.0818 3.0000 27.1358 59 | v -47.0818 0.0000 27.1358 60 | v -42.7517 3.0000 24.6358 61 | v -42.7517 0.0000 24.6358 62 | v -53.0209 3.0000 10.8182 63 | v -53.0209 0.0000 10.8182 64 | v -48.0969 3.0000 9.9499 65 | v -48.0969 0.0000 9.9499 66 | v -53.0209 3.0000 -6.5466 67 | v -53.0209 0.0000 -6.5466 68 | v -48.0969 3.0000 -5.6784 69 | v -48.0969 0.0000 -5.6784 70 | v -47.0818 3.0000 -22.8642 71 | v -47.0818 0.0000 -22.8642 72 | v -42.7517 3.0000 -20.3642 73 | v -42.7517 0.0000 -20.3642 74 | v -35.9199 3.0000 -36.1664 75 | v -35.9199 0.0000 -36.1664 76 | v -32.7060 3.0000 -32.3362 77 | v -32.7060 0.0000 -32.3362 78 | v -20.8815 3.0000 -44.8489 79 | v -20.8815 0.0000 -44.8489 80 | v -19.1714 3.0000 -40.1504 81 | v -19.1714 0.0000 -40.1504 82 | # 72 vertices 83 | 84 | vn 0.0000 0.0000 -1.0000 85 | vn 0.3420 0.0000 -0.9397 86 | vn 0.0000 1.0000 -0.0000 87 | vn -0.0000 0.0000 1.0000 88 | vn -0.3420 0.0000 0.9397 89 | vn 0.0000 -1.0000 -0.0000 90 | vn 0.6428 0.0000 -0.7660 91 | vn -0.6428 0.0000 0.7660 92 | vn 0.8660 0.0000 -0.5000 93 | vn -0.8660 0.0000 0.5000 94 | vn 0.9848 0.0000 -0.1736 95 | vn -0.9848 0.0000 0.1736 96 | vn 0.9848 0.0000 0.1736 97 | vn -0.9848 0.0000 -0.1736 98 | vn 0.8660 0.0000 0.5000 99 | vn -0.8660 0.0000 -0.5000 100 | vn 0.6428 0.0000 0.7660 101 | vn -0.6428 0.0000 -0.7660 102 | vn 0.3420 0.0000 0.9397 103 | vn -0.3420 0.0000 -0.9397 104 | # 20 vertex normals 105 | 106 | vt 0.0000 0.0000 0.0000 107 | vt 0.2500 0.0556 0.0000 108 | vt 0.0000 0.0556 0.0000 109 | vt 0.2500 0.0000 0.0000 110 | vt 0.5000 0.0556 0.0000 111 | vt 0.5000 0.0000 0.0000 112 | vt 0.7500 0.0556 0.0000 113 | vt 0.7500 0.0000 0.0000 114 | vt 1.0000 0.0556 0.0000 115 | vt 1.0000 0.0000 0.0000 116 | vt 0.2500 0.1111 0.0000 117 | vt 0.0000 0.1111 0.0000 118 | vt 0.5000 0.1111 0.0000 119 | vt 0.7500 0.1111 0.0000 120 | vt 1.0000 0.1111 0.0000 121 | vt 0.2500 0.1667 0.0000 122 | vt 0.0000 0.1667 0.0000 123 | vt 0.5000 0.1667 0.0000 124 | vt 0.7500 0.1667 0.0000 125 | vt 1.0000 0.1667 0.0000 126 | vt 0.2500 0.2222 0.0000 127 | vt 0.0000 0.2222 0.0000 128 | vt 0.5000 0.2222 0.0000 129 | vt 0.7500 0.2222 0.0000 130 | vt 1.0000 0.2222 0.0000 131 | vt 0.2500 0.2778 0.0000 132 | vt 0.0000 0.2778 0.0000 133 | vt 0.5000 0.2778 0.0000 134 | vt 0.7500 0.2778 0.0000 135 | vt 1.0000 0.2778 0.0000 136 | vt 0.2500 0.3333 0.0000 137 | vt 0.0000 0.3333 0.0000 138 | vt 0.5000 0.3333 0.0000 139 | vt 0.7500 0.3333 0.0000 140 | vt 1.0000 0.3333 0.0000 141 | vt 0.2500 0.3889 0.0000 142 | vt 0.0000 0.3889 0.0000 143 | vt 0.5000 0.3889 0.0000 144 | vt 0.7500 0.3889 0.0000 145 | vt 1.0000 0.3889 0.0000 146 | vt 0.2500 0.4444 0.0000 147 | vt 0.0000 0.4444 0.0000 148 | vt 0.5000 0.4444 0.0000 149 | vt 0.7500 0.4444 0.0000 150 | vt 1.0000 0.4444 0.0000 151 | vt 0.2500 0.5000 0.0000 152 | vt 0.0000 0.5000 0.0000 153 | vt 0.5000 0.5000 0.0000 154 | vt 0.7500 0.5000 0.0000 155 | vt 1.0000 0.5000 0.0000 156 | vt 0.2500 0.5556 0.0000 157 | vt 0.0000 0.5556 0.0000 158 | vt 0.5000 0.5556 0.0000 159 | vt 0.7500 0.5556 0.0000 160 | vt 1.0000 0.5556 0.0000 161 | vt 0.2500 0.6111 0.0000 162 | vt 0.0000 0.6111 0.0000 163 | vt 0.5000 0.6111 0.0000 164 | vt 0.7500 0.6111 0.0000 165 | vt 1.0000 0.6111 0.0000 166 | vt 0.2500 0.6667 0.0000 167 | vt 0.0000 0.6667 0.0000 168 | vt 0.5000 0.6667 0.0000 169 | vt 0.7500 0.6667 0.0000 170 | vt 1.0000 0.6667 0.0000 171 | vt 0.2500 0.7222 0.0000 172 | vt 0.0000 0.7222 0.0000 173 | vt 0.5000 0.7222 0.0000 174 | vt 0.7500 0.7222 0.0000 175 | vt 1.0000 0.7222 0.0000 176 | vt 0.2500 0.7778 0.0000 177 | vt 0.0000 0.7778 0.0000 178 | vt 0.5000 0.7778 0.0000 179 | vt 0.7500 0.7778 0.0000 180 | vt 1.0000 0.7778 0.0000 181 | vt 0.2500 0.8333 0.0000 182 | vt 0.0000 0.8333 0.0000 183 | vt 0.5000 0.8333 0.0000 184 | vt 0.7500 0.8333 0.0000 185 | vt 1.0000 0.8333 0.0000 186 | vt 0.2500 0.8889 0.0000 187 | vt 0.0000 0.8889 0.0000 188 | vt 0.5000 0.8889 0.0000 189 | vt 0.7500 0.8889 0.0000 190 | vt 1.0000 0.8889 0.0000 191 | vt 0.2500 0.9444 0.0000 192 | vt 0.0000 0.9444 0.0000 193 | vt 0.5000 0.9444 0.0000 194 | vt 0.7500 0.9444 0.0000 195 | vt 1.0000 0.9444 0.0000 196 | vt 0.2500 1.0000 0.0000 197 | vt 0.0000 1.0000 0.0000 198 | vt 0.5000 1.0000 0.0000 199 | vt 0.7500 1.0000 0.0000 200 | vt 1.0000 1.0000 0.0000 201 | # 95 texture coords 202 | 203 | g y_rot_axis 204 | usemtl 01___Default 205 | s 2 206 | f 1/1/1 2/2/2 3/3/2 207 | f 1/1/1 4/4/1 2/2/2 208 | s 4 209 | f 4/4/3 5/5/3 2/2/3 210 | f 4/4/3 6/6/3 5/5/3 211 | s 2 212 | f 6/6/4 7/7/5 5/5/5 213 | f 6/6/4 8/8/4 7/7/5 214 | s 4 215 | f 8/8/6 3/9/6 7/7/6 216 | f 8/8/6 1/10/6 3/9/6 217 | s 2 218 | f 3/3/2 9/11/7 10/12/7 219 | f 3/3/2 2/2/2 9/11/7 220 | s 4 221 | f 2/2/3 11/13/3 9/11/3 222 | f 2/2/3 5/5/3 11/13/3 223 | s 2 224 | f 5/5/5 12/14/8 11/13/8 225 | f 5/5/5 7/7/5 12/14/8 226 | s 4 227 | f 7/7/6 10/15/6 12/14/6 228 | f 7/7/6 3/9/6 10/15/6 229 | s 2 230 | f 10/12/7 13/16/9 14/17/9 231 | f 10/12/7 9/11/7 13/16/9 232 | s 4 233 | f 9/11/3 15/18/3 13/16/3 234 | f 9/11/3 11/13/3 15/18/3 235 | s 2 236 | f 11/13/8 16/19/10 15/18/10 237 | f 11/13/8 12/14/8 16/19/10 238 | s 4 239 | f 12/14/6 14/20/6 16/19/6 240 | f 12/14/6 10/15/6 14/20/6 241 | s 2 242 | f 14/17/9 17/21/11 18/22/11 243 | f 14/17/9 13/16/9 17/21/11 244 | s 4 245 | f 13/16/3 19/23/3 17/21/3 246 | f 13/16/3 15/18/3 19/23/3 247 | s 2 248 | f 15/18/10 20/24/12 19/23/12 249 | f 15/18/10 16/19/10 20/24/12 250 | s 4 251 | f 16/19/6 18/25/6 20/24/6 252 | f 16/19/6 14/20/6 18/25/6 253 | s 2 254 | f 18/22/11 21/26/13 22/27/13 255 | f 18/22/11 17/21/11 21/26/13 256 | s 4 257 | f 17/21/3 23/28/3 21/26/3 258 | f 17/21/3 19/23/3 23/28/3 259 | s 2 260 | f 19/23/12 24/29/14 23/28/14 261 | f 19/23/12 20/24/12 24/29/14 262 | s 4 263 | f 20/24/6 22/30/6 24/29/6 264 | f 20/24/6 18/25/6 22/30/6 265 | s 2 266 | f 22/27/13 25/31/15 26/32/15 267 | f 22/27/13 21/26/13 25/31/15 268 | s 4 269 | f 21/26/3 27/33/3 25/31/3 270 | f 21/26/3 23/28/3 27/33/3 271 | s 2 272 | f 23/28/14 28/34/16 27/33/16 273 | f 23/28/14 24/29/14 28/34/16 274 | s 4 275 | f 24/29/6 26/35/6 28/34/6 276 | f 24/29/6 22/30/6 26/35/6 277 | s 2 278 | f 26/32/15 29/36/17 30/37/17 279 | f 26/32/15 25/31/15 29/36/17 280 | s 4 281 | f 25/31/3 31/38/3 29/36/3 282 | f 25/31/3 27/33/3 31/38/3 283 | s 2 284 | f 27/33/16 32/39/18 31/38/18 285 | f 27/33/16 28/34/16 32/39/18 286 | s 4 287 | f 28/34/6 30/40/6 32/39/6 288 | f 28/34/6 26/35/6 30/40/6 289 | s 2 290 | f 30/37/17 33/41/19 34/42/19 291 | f 30/37/17 29/36/17 33/41/19 292 | s 4 293 | f 29/36/3 35/43/3 33/41/3 294 | f 29/36/3 31/38/3 35/43/3 295 | s 2 296 | f 31/38/18 36/44/20 35/43/20 297 | f 31/38/18 32/39/18 36/44/20 298 | s 4 299 | f 32/39/6 34/45/6 36/44/6 300 | f 32/39/6 30/40/6 34/45/6 301 | s 2 302 | f 34/42/19 37/46/4 38/47/4 303 | f 34/42/19 33/41/19 37/46/4 304 | s 4 305 | f 33/41/3 39/48/3 37/46/3 306 | f 33/41/3 35/43/3 39/48/3 307 | s 2 308 | f 35/43/20 40/49/1 39/48/1 309 | f 35/43/20 36/44/20 40/49/1 310 | s 4 311 | f 36/44/6 38/50/6 40/49/6 312 | f 36/44/6 34/45/6 38/50/6 313 | s 2 314 | f 38/47/4 41/51/5 42/52/5 315 | f 38/47/4 37/46/4 41/51/5 316 | s 4 317 | f 37/46/3 43/53/3 41/51/3 318 | f 37/46/3 39/48/3 43/53/3 319 | s 2 320 | f 39/48/1 44/54/2 43/53/2 321 | f 39/48/1 40/49/1 44/54/2 322 | s 4 323 | f 40/49/6 42/55/6 44/54/6 324 | f 40/49/6 38/50/6 42/55/6 325 | s 2 326 | f 42/52/5 45/56/8 46/57/8 327 | f 42/52/5 41/51/5 45/56/8 328 | s 4 329 | f 41/51/3 47/58/3 45/56/3 330 | f 41/51/3 43/53/3 47/58/3 331 | s 2 332 | f 43/53/2 48/59/7 47/58/7 333 | f 43/53/2 44/54/2 48/59/7 334 | s 4 335 | f 44/54/6 46/60/6 48/59/6 336 | f 44/54/6 42/55/6 46/60/6 337 | s 2 338 | f 46/57/8 49/61/10 50/62/10 339 | f 46/57/8 45/56/8 49/61/10 340 | s 4 341 | f 45/56/3 51/63/3 49/61/3 342 | f 45/56/3 47/58/3 51/63/3 343 | s 2 344 | f 47/58/7 52/64/9 51/63/9 345 | f 47/58/7 48/59/7 52/64/9 346 | s 4 347 | f 48/59/6 50/65/6 52/64/6 348 | f 48/59/6 46/60/6 50/65/6 349 | s 2 350 | f 50/62/10 53/66/12 54/67/12 351 | f 50/62/10 49/61/10 53/66/12 352 | s 4 353 | f 49/61/3 55/68/3 53/66/3 354 | f 49/61/3 51/63/3 55/68/3 355 | s 2 356 | f 51/63/9 56/69/11 55/68/11 357 | f 51/63/9 52/64/9 56/69/11 358 | s 4 359 | f 52/64/6 54/70/6 56/69/6 360 | f 52/64/6 50/65/6 54/70/6 361 | s 2 362 | f 54/67/12 57/71/14 58/72/14 363 | f 54/67/12 53/66/12 57/71/14 364 | s 4 365 | f 53/66/3 59/73/3 57/71/3 366 | f 53/66/3 55/68/3 59/73/3 367 | s 2 368 | f 55/68/11 60/74/13 59/73/13 369 | f 55/68/11 56/69/11 60/74/13 370 | s 4 371 | f 56/69/6 58/75/6 60/74/6 372 | f 56/69/6 54/70/6 58/75/6 373 | s 2 374 | f 58/72/14 61/76/16 62/77/16 375 | f 58/72/14 57/71/14 61/76/16 376 | s 4 377 | f 57/71/3 63/78/3 61/76/3 378 | f 57/71/3 59/73/3 63/78/3 379 | s 2 380 | f 59/73/13 64/79/15 63/78/15 381 | f 59/73/13 60/74/13 64/79/15 382 | s 4 383 | f 60/74/6 62/80/6 64/79/6 384 | f 60/74/6 58/75/6 62/80/6 385 | s 2 386 | f 62/77/16 65/81/18 66/82/18 387 | f 62/77/16 61/76/16 65/81/18 388 | s 4 389 | f 61/76/3 67/83/3 65/81/3 390 | f 61/76/3 63/78/3 67/83/3 391 | s 2 392 | f 63/78/15 68/84/17 67/83/17 393 | f 63/78/15 64/79/15 68/84/17 394 | s 4 395 | f 64/79/6 66/85/6 68/84/6 396 | f 64/79/6 62/80/6 66/85/6 397 | s 2 398 | f 66/82/18 69/86/20 70/87/20 399 | f 66/82/18 65/81/18 69/86/20 400 | s 4 401 | f 65/81/3 71/88/3 69/86/3 402 | f 65/81/3 67/83/3 71/88/3 403 | s 2 404 | f 67/83/17 72/89/19 71/88/19 405 | f 67/83/17 68/84/17 72/89/19 406 | s 4 407 | f 68/84/6 70/90/6 72/89/6 408 | f 68/84/6 66/85/6 70/90/6 409 | s 2 410 | f 70/87/20 4/91/1 1/92/1 411 | f 70/87/20 69/86/20 4/91/1 412 | s 4 413 | f 69/86/3 6/93/3 4/91/3 414 | f 69/86/3 71/88/3 6/93/3 415 | s 2 416 | f 71/88/19 8/94/4 6/93/4 417 | f 71/88/19 72/89/19 8/94/4 418 | s 4 419 | f 72/89/6 1/95/6 8/94/6 420 | f 72/89/6 70/90/6 1/95/6 421 | # 144 faces 422 | 423 | -------------------------------------------------------------------------------- /editor/meshes/y-scale-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 20.11.2017 11:48:08 3 | 4 | mtllib y-scale-axis.mtl 5 | 6 | # 7 | o y_scale_axis 8 | # 9 | 10 | v -2.7107 52.6864 3.9524 11 | v -2.7107 52.6864 3.4524 12 | v -3.2107 52.6864 3.4524 13 | v -3.2107 52.6864 3.9524 14 | v -2.7107 1.7540 3.9524 15 | v -3.2107 1.7540 3.9524 16 | v -3.2107 1.7540 3.4524 17 | v -2.7107 1.7540 3.4524 18 | v 6.9521 58.0170 13.7454 19 | v 6.9521 58.0170 -6.2546 20 | v -13.0479 58.0170 -6.2546 21 | v -13.0479 58.0170 13.7454 22 | v 6.9521 54.4610 13.7454 23 | v -13.0479 54.4610 13.7454 24 | v -13.0479 54.4610 -6.2546 25 | v 6.9521 54.4610 -6.2546 26 | # 16 vertices 27 | 28 | vn 0.0000 1.0000 -0.0000 29 | vn -0.0000 -1.0000 0.0000 30 | vn -0.0000 0.0000 1.0000 31 | vn -1.0000 0.0000 -0.0000 32 | vn 0.0000 -0.0000 -1.0000 33 | vn 1.0000 -0.0000 0.0000 34 | # 6 vertex normals 35 | 36 | vt 0.0000 0.0000 0.0000 37 | vt 1.0000 0.0000 0.0000 38 | vt 1.0000 1.0000 0.0000 39 | vt 0.0000 1.0000 0.0000 40 | # 4 texture coords 41 | 42 | g y_scale_axis 43 | usemtl 01___Default 44 | s 2 45 | f 1/1/1 2/2/1 3/3/1 46 | f 3/3/1 4/4/1 1/1/1 47 | s 4 48 | f 5/1/2 6/2/2 7/3/2 49 | f 7/3/2 8/4/2 5/1/2 50 | s 8 51 | f 1/1/3 4/2/3 6/3/3 52 | f 6/3/3 5/4/3 1/1/3 53 | s 16 54 | f 4/1/4 3/2/4 7/3/4 55 | f 7/3/4 6/4/4 4/1/4 56 | s 32 57 | f 3/1/5 2/2/5 8/3/5 58 | f 8/3/5 7/4/5 3/1/5 59 | s 64 60 | f 2/1/6 1/2/6 5/3/6 61 | f 5/3/6 8/4/6 2/1/6 62 | s 2 63 | f 9/1/1 10/2/1 11/3/1 64 | f 11/3/1 12/4/1 9/1/1 65 | s 4 66 | f 13/1/2 14/2/2 15/3/2 67 | f 15/3/2 16/4/2 13/1/2 68 | s 8 69 | f 9/1/3 12/2/3 14/3/3 70 | f 14/3/3 13/4/3 9/1/3 71 | s 16 72 | f 12/1/4 11/2/4 15/3/4 73 | f 15/3/4 14/4/4 12/1/4 74 | s 32 75 | f 11/1/5 10/2/5 16/3/5 76 | f 16/3/5 15/4/5 11/1/5 77 | s 64 78 | f 10/1/6 9/2/6 13/3/6 79 | f 13/3/6 16/4/6 10/1/6 80 | # 24 faces 81 | 82 | -------------------------------------------------------------------------------- /editor/meshes/z-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 15.11.2017 22:38:11 3 | 4 | mtllib z-axis.mtl 5 | 6 | # 7 | o z_axis 8 | # 9 | 10 | v -4.2402 -0.4417 84.0861 11 | v 3.8974 7.6959 84.0861 12 | v 7.2681 -0.4417 84.0861 13 | v -4.2402 11.0666 84.0861 14 | v -12.3778 7.6959 84.0861 15 | v -15.7485 -0.4417 84.0861 16 | v -12.3778 -8.5793 84.0861 17 | v -4.2402 -11.9501 84.0861 18 | v 3.8974 -8.5793 84.0861 19 | v -4.2402 -0.4417 104.6728 20 | v -4.7704 -1.1736 84.0250 21 | v -4.7704 -1.1736 0.7070 22 | v -2.9432 -1.1736 0.7070 23 | v -2.9432 -1.1736 84.0250 24 | v -4.7704 0.2881 84.0250 25 | v -2.9432 0.2881 84.0250 26 | v -2.9432 0.2881 0.7070 27 | v -4.7704 0.2881 0.7070 28 | # 18 vertices 29 | 30 | vn 0.0000 0.0000 -1.0000 31 | vn 0.8729 -0.0000 0.4880 32 | vn 0.8209 0.3400 0.4589 33 | vn 0.8209 -0.3400 0.4589 34 | vn 0.6172 0.6172 0.4880 35 | vn 0.3400 0.8209 0.4589 36 | vn -0.0000 0.8729 0.4880 37 | vn -0.3400 0.8209 0.4589 38 | vn -0.6172 0.6172 0.4880 39 | vn -0.8209 0.3400 0.4589 40 | vn -0.8729 -0.0000 0.4880 41 | vn -0.8209 -0.3400 0.4589 42 | vn -0.6172 -0.6172 0.4879 43 | vn -0.3400 -0.8209 0.4589 44 | vn -0.0000 -0.8729 0.4879 45 | vn 0.3400 -0.8209 0.4589 46 | vn 0.6172 -0.6172 0.4879 47 | vn 1.0000 0.0000 -0.0000 48 | vn 0.0000 -1.0000 0.0000 49 | vn 0.0000 1.0000 0.0000 50 | vn 0.0000 -0.0000 1.0000 51 | vn -1.0000 0.0000 -0.0000 52 | # 22 vertex normals 53 | 54 | vt 0.5000 0.5000 0.8020 55 | vt 0.8536 0.8536 0.8020 56 | vt 1.0000 0.5000 0.8020 57 | vt 0.5000 1.0000 0.8020 58 | vt 0.1464 0.8536 0.8020 59 | vt 0.0000 0.5000 0.8020 60 | vt 0.1464 0.1464 0.8020 61 | vt 0.5000 0.0000 0.8020 62 | vt 0.8536 0.1464 0.8020 63 | vt 0.5000 0.5000 1.0000 64 | vt 0.4770 0.4682 0.8014 65 | vt 0.4770 0.4682 0.0000 66 | vt 0.5563 0.4682 0.0000 67 | vt 0.5563 0.4682 0.8014 68 | vt 0.4770 0.5317 0.8014 69 | vt 0.5563 0.5317 0.8014 70 | vt 0.5563 0.5317 0.0000 71 | vt 0.4770 0.5317 0.0000 72 | # 18 texture coords 73 | 74 | g z_axis 75 | usemtl wire_085028177 76 | s 1 77 | f 1/1/1 2/2/1 3/3/1 78 | f 1/1/1 4/4/1 2/2/1 79 | f 1/1/1 5/5/1 4/4/1 80 | f 1/1/1 6/6/1 5/5/1 81 | f 1/1/1 7/7/1 6/6/1 82 | f 1/1/1 8/8/1 7/7/1 83 | f 1/1/1 9/9/1 8/8/1 84 | f 1/1/1 3/3/1 9/9/1 85 | s 8 86 | f 3/3/2 10/10/3 10/10/4 87 | f 3/3/2 2/2/5 10/10/3 88 | f 2/2/5 10/10/6 10/10/3 89 | f 2/2/5 4/4/7 10/10/6 90 | f 4/4/7 10/10/8 10/10/6 91 | f 4/4/7 5/5/9 10/10/8 92 | f 5/5/9 10/10/10 10/10/8 93 | f 5/5/9 6/6/11 10/10/10 94 | f 6/6/11 10/10/12 10/10/10 95 | f 6/6/11 7/7/13 10/10/12 96 | f 7/7/13 10/10/14 10/10/12 97 | f 7/7/13 8/8/15 10/10/14 98 | f 8/8/15 10/10/16 10/10/14 99 | f 8/8/15 9/9/17 10/10/16 100 | f 9/9/17 10/10/4 10/10/16 101 | f 9/9/17 3/3/2 10/10/4 102 | s 1 103 | f 10/10/18 10/10/18 10/10/18 104 | f 10/10/18 10/10/18 10/10/18 105 | f 10/10/18 10/10/18 10/10/18 106 | f 10/10/18 10/10/18 10/10/18 107 | f 10/10/18 10/10/18 10/10/18 108 | f 10/10/18 10/10/18 10/10/18 109 | f 10/10/18 10/10/18 10/10/18 110 | f 10/10/18 10/10/18 10/10/18 111 | s 2 112 | f 11/11/19 12/12/19 13/13/19 113 | f 13/13/19 14/14/19 11/11/19 114 | s 4 115 | f 15/15/20 16/16/20 17/17/20 116 | f 17/17/20 18/18/20 15/15/20 117 | s 8 118 | f 11/11/21 14/14/21 16/16/21 119 | f 16/16/21 15/15/21 11/11/21 120 | s 16 121 | f 14/14/18 13/13/18 17/17/18 122 | f 17/17/18 16/16/18 14/14/18 123 | s 32 124 | f 13/13/1 12/12/1 18/18/1 125 | f 18/18/1 17/17/1 13/13/1 126 | s 64 127 | f 12/12/22 11/11/22 15/15/22 128 | f 15/15/22 18/18/22 12/12/22 129 | # 44 faces 130 | 131 | -------------------------------------------------------------------------------- /editor/meshes/z-rot-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 17.11.2017 14:30:40 3 | 4 | mtllib z-rot-axis.mtl 5 | 6 | # 7 | o z_rot_axis 8 | # 9 | 10 | v -4.6404 50.7050 1.2028 11 | v 12.4606 47.6896 4.2028 12 | v 12.4606 47.6896 1.2028 13 | v -4.6404 50.7050 4.2028 14 | v 10.7505 42.9912 4.2028 15 | v -4.6404 45.7050 4.2028 16 | v 10.7505 42.9912 1.2028 17 | v -4.6404 45.7050 1.2028 18 | v 27.4990 39.0072 4.2028 19 | v 27.4990 39.0072 1.2028 20 | v 24.2850 35.1770 4.2028 21 | v 24.2850 35.1770 1.2028 22 | v 38.6609 25.7050 4.2028 23 | v 38.6609 25.7050 1.2028 24 | v 34.3307 23.2050 4.2028 25 | v 34.3307 23.2050 1.2028 26 | v 44.6000 9.3874 4.2028 27 | v 44.6000 9.3874 1.2028 28 | v 39.6759 8.5192 4.2028 29 | v 39.6759 8.5192 1.2028 30 | v 44.6000 -7.9774 4.2028 31 | v 44.6000 -7.9774 1.2028 32 | v 39.6759 -7.1092 4.2028 33 | v 39.6759 -7.1092 1.2028 34 | v 38.6609 -24.2950 4.2028 35 | v 38.6609 -24.2950 1.2028 36 | v 34.3307 -21.7950 4.2028 37 | v 34.3307 -21.7950 1.2028 38 | v 27.4990 -37.5972 4.2028 39 | v 27.4990 -37.5972 1.2028 40 | v 24.2850 -33.7670 4.2028 41 | v 24.2850 -33.7670 1.2028 42 | v 12.4606 -46.2796 4.2028 43 | v 12.4606 -46.2796 1.2028 44 | v 10.7505 -41.5812 4.2028 45 | v 10.7505 -41.5812 1.2028 46 | v -4.6404 -49.2950 4.2028 47 | v -4.6404 -49.2950 1.2028 48 | v -4.6404 -44.2950 4.2028 49 | v -4.6404 -44.2950 1.2028 50 | v -21.7414 -46.2796 4.2028 51 | v -21.7414 -46.2796 1.2028 52 | v -20.0313 -41.5812 4.2028 53 | v -20.0313 -41.5812 1.2028 54 | v -36.7798 -37.5972 4.2028 55 | v -36.7798 -37.5972 1.2028 56 | v -33.5659 -33.7670 4.2028 57 | v -33.5659 -33.7670 1.2028 58 | v -47.9417 -24.2950 4.2028 59 | v -47.9417 -24.2950 1.2028 60 | v -43.6116 -21.7950 4.2028 61 | v -43.6116 -21.7950 1.2028 62 | v -53.8808 -7.9774 4.2028 63 | v -53.8808 -7.9774 1.2028 64 | v -48.9568 -7.1092 4.2028 65 | v -48.9568 -7.1092 1.2028 66 | v -53.8808 9.3874 4.2028 67 | v -53.8808 9.3874 1.2028 68 | v -48.9568 8.5192 4.2028 69 | v -48.9568 8.5192 1.2028 70 | v -47.9417 25.7050 4.2028 71 | v -47.9417 25.7050 1.2028 72 | v -43.6115 23.2050 4.2028 73 | v -43.6115 23.2050 1.2028 74 | v -36.7798 39.0072 4.2028 75 | v -36.7798 39.0072 1.2028 76 | v -33.5658 35.1770 4.2028 77 | v -33.5658 35.1770 1.2028 78 | v -21.7414 47.6896 4.2028 79 | v -21.7414 47.6896 1.2028 80 | v -20.0313 42.9912 4.2028 81 | v -20.0313 42.9912 1.2028 82 | # 72 vertices 83 | 84 | vn 0.0000 1.0000 0.0000 85 | vn 0.3420 0.9397 0.0000 86 | vn 0.0000 -0.0000 1.0000 87 | vn -0.0000 -1.0000 -0.0000 88 | vn -0.3420 -0.9397 -0.0000 89 | vn 0.0000 0.0000 -1.0000 90 | vn 0.6428 0.7660 0.0000 91 | vn -0.6428 -0.7660 -0.0000 92 | vn 0.8660 0.5000 0.0000 93 | vn -0.8660 -0.5000 -0.0000 94 | vn 0.9848 0.1736 0.0000 95 | vn -0.9848 -0.1736 -0.0000 96 | vn 0.9848 -0.1736 -0.0000 97 | vn -0.9848 0.1736 0.0000 98 | vn 0.8660 -0.5000 -0.0000 99 | vn -0.8660 0.5000 0.0000 100 | vn 0.6428 -0.7660 -0.0000 101 | vn -0.6428 0.7660 0.0000 102 | vn 0.3420 -0.9397 -0.0000 103 | vn -0.3420 0.9397 0.0000 104 | # 20 vertex normals 105 | 106 | vt 0.0000 0.0000 0.0000 107 | vt 0.2500 0.0556 0.0000 108 | vt 0.0000 0.0556 0.0000 109 | vt 0.2500 0.0000 0.0000 110 | vt 0.5000 0.0556 0.0000 111 | vt 0.5000 0.0000 0.0000 112 | vt 0.7500 0.0556 0.0000 113 | vt 0.7500 0.0000 0.0000 114 | vt 1.0000 0.0556 0.0000 115 | vt 1.0000 0.0000 0.0000 116 | vt 0.2500 0.1111 0.0000 117 | vt 0.0000 0.1111 0.0000 118 | vt 0.5000 0.1111 0.0000 119 | vt 0.7500 0.1111 0.0000 120 | vt 1.0000 0.1111 0.0000 121 | vt 0.2500 0.1667 0.0000 122 | vt 0.0000 0.1667 0.0000 123 | vt 0.5000 0.1667 0.0000 124 | vt 0.7500 0.1667 0.0000 125 | vt 1.0000 0.1667 0.0000 126 | vt 0.2500 0.2222 0.0000 127 | vt 0.0000 0.2222 0.0000 128 | vt 0.5000 0.2222 0.0000 129 | vt 0.7500 0.2222 0.0000 130 | vt 1.0000 0.2222 0.0000 131 | vt 0.2500 0.2778 0.0000 132 | vt 0.0000 0.2778 0.0000 133 | vt 0.5000 0.2778 0.0000 134 | vt 0.7500 0.2778 0.0000 135 | vt 1.0000 0.2778 0.0000 136 | vt 0.2500 0.3333 0.0000 137 | vt 0.0000 0.3333 0.0000 138 | vt 0.5000 0.3333 0.0000 139 | vt 0.7500 0.3333 0.0000 140 | vt 1.0000 0.3333 0.0000 141 | vt 0.2500 0.3889 0.0000 142 | vt 0.0000 0.3889 0.0000 143 | vt 0.5000 0.3889 0.0000 144 | vt 0.7500 0.3889 0.0000 145 | vt 1.0000 0.3889 0.0000 146 | vt 0.2500 0.4444 0.0000 147 | vt 0.0000 0.4444 0.0000 148 | vt 0.5000 0.4444 0.0000 149 | vt 0.7500 0.4444 0.0000 150 | vt 1.0000 0.4444 0.0000 151 | vt 0.2500 0.5000 0.0000 152 | vt 0.0000 0.5000 0.0000 153 | vt 0.5000 0.5000 0.0000 154 | vt 0.7500 0.5000 0.0000 155 | vt 1.0000 0.5000 0.0000 156 | vt 0.2500 0.5556 0.0000 157 | vt 0.0000 0.5556 0.0000 158 | vt 0.5000 0.5556 0.0000 159 | vt 0.7500 0.5556 0.0000 160 | vt 1.0000 0.5556 0.0000 161 | vt 0.2500 0.6111 0.0000 162 | vt 0.0000 0.6111 0.0000 163 | vt 0.5000 0.6111 0.0000 164 | vt 0.7500 0.6111 0.0000 165 | vt 1.0000 0.6111 0.0000 166 | vt 0.2500 0.6667 0.0000 167 | vt 0.0000 0.6667 0.0000 168 | vt 0.5000 0.6667 0.0000 169 | vt 0.7500 0.6667 0.0000 170 | vt 1.0000 0.6667 0.0000 171 | vt 0.2500 0.7222 0.0000 172 | vt 0.0000 0.7222 0.0000 173 | vt 0.5000 0.7222 0.0000 174 | vt 0.7500 0.7222 0.0000 175 | vt 1.0000 0.7222 0.0000 176 | vt 0.2500 0.7778 0.0000 177 | vt 0.0000 0.7778 0.0000 178 | vt 0.5000 0.7778 0.0000 179 | vt 0.7500 0.7778 0.0000 180 | vt 1.0000 0.7778 0.0000 181 | vt 0.2500 0.8333 0.0000 182 | vt 0.0000 0.8333 0.0000 183 | vt 0.5000 0.8333 0.0000 184 | vt 0.7500 0.8333 0.0000 185 | vt 1.0000 0.8333 0.0000 186 | vt 0.2500 0.8889 0.0000 187 | vt 0.0000 0.8889 0.0000 188 | vt 0.5000 0.8889 0.0000 189 | vt 0.7500 0.8889 0.0000 190 | vt 1.0000 0.8889 0.0000 191 | vt 0.2500 0.9444 0.0000 192 | vt 0.0000 0.9444 0.0000 193 | vt 0.5000 0.9444 0.0000 194 | vt 0.7500 0.9444 0.0000 195 | vt 1.0000 0.9444 0.0000 196 | vt 0.2500 1.0000 0.0000 197 | vt 0.0000 1.0000 0.0000 198 | vt 0.5000 1.0000 0.0000 199 | vt 0.7500 1.0000 0.0000 200 | vt 1.0000 1.0000 0.0000 201 | # 95 texture coords 202 | 203 | g z_rot_axis 204 | usemtl 01___Default 205 | s 2 206 | f 1/1/1 2/2/2 3/3/2 207 | f 1/1/1 4/4/1 2/2/2 208 | s 4 209 | f 4/4/3 5/5/3 2/2/3 210 | f 4/4/3 6/6/3 5/5/3 211 | s 2 212 | f 6/6/4 7/7/5 5/5/5 213 | f 6/6/4 8/8/4 7/7/5 214 | s 4 215 | f 8/8/6 3/9/6 7/7/6 216 | f 8/8/6 1/10/6 3/9/6 217 | s 2 218 | f 3/3/2 9/11/7 10/12/7 219 | f 3/3/2 2/2/2 9/11/7 220 | s 4 221 | f 2/2/3 11/13/3 9/11/3 222 | f 2/2/3 5/5/3 11/13/3 223 | s 2 224 | f 5/5/5 12/14/8 11/13/8 225 | f 5/5/5 7/7/5 12/14/8 226 | s 4 227 | f 7/7/6 10/15/6 12/14/6 228 | f 7/7/6 3/9/6 10/15/6 229 | s 2 230 | f 10/12/7 13/16/9 14/17/9 231 | f 10/12/7 9/11/7 13/16/9 232 | s 4 233 | f 9/11/3 15/18/3 13/16/3 234 | f 9/11/3 11/13/3 15/18/3 235 | s 2 236 | f 11/13/8 16/19/10 15/18/10 237 | f 11/13/8 12/14/8 16/19/10 238 | s 4 239 | f 12/14/6 14/20/6 16/19/6 240 | f 12/14/6 10/15/6 14/20/6 241 | s 2 242 | f 14/17/9 17/21/11 18/22/11 243 | f 14/17/9 13/16/9 17/21/11 244 | s 4 245 | f 13/16/3 19/23/3 17/21/3 246 | f 13/16/3 15/18/3 19/23/3 247 | s 2 248 | f 15/18/10 20/24/12 19/23/12 249 | f 15/18/10 16/19/10 20/24/12 250 | s 4 251 | f 16/19/6 18/25/6 20/24/6 252 | f 16/19/6 14/20/6 18/25/6 253 | s 2 254 | f 18/22/11 21/26/13 22/27/13 255 | f 18/22/11 17/21/11 21/26/13 256 | s 4 257 | f 17/21/3 23/28/3 21/26/3 258 | f 17/21/3 19/23/3 23/28/3 259 | s 2 260 | f 19/23/12 24/29/14 23/28/14 261 | f 19/23/12 20/24/12 24/29/14 262 | s 4 263 | f 20/24/6 22/30/6 24/29/6 264 | f 20/24/6 18/25/6 22/30/6 265 | s 2 266 | f 22/27/13 25/31/15 26/32/15 267 | f 22/27/13 21/26/13 25/31/15 268 | s 4 269 | f 21/26/3 27/33/3 25/31/3 270 | f 21/26/3 23/28/3 27/33/3 271 | s 2 272 | f 23/28/14 28/34/16 27/33/16 273 | f 23/28/14 24/29/14 28/34/16 274 | s 4 275 | f 24/29/6 26/35/6 28/34/6 276 | f 24/29/6 22/30/6 26/35/6 277 | s 2 278 | f 26/32/15 29/36/17 30/37/17 279 | f 26/32/15 25/31/15 29/36/17 280 | s 4 281 | f 25/31/3 31/38/3 29/36/3 282 | f 25/31/3 27/33/3 31/38/3 283 | s 2 284 | f 27/33/16 32/39/18 31/38/18 285 | f 27/33/16 28/34/16 32/39/18 286 | s 4 287 | f 28/34/6 30/40/6 32/39/6 288 | f 28/34/6 26/35/6 30/40/6 289 | s 2 290 | f 30/37/17 33/41/19 34/42/19 291 | f 30/37/17 29/36/17 33/41/19 292 | s 4 293 | f 29/36/3 35/43/3 33/41/3 294 | f 29/36/3 31/38/3 35/43/3 295 | s 2 296 | f 31/38/18 36/44/20 35/43/20 297 | f 31/38/18 32/39/18 36/44/20 298 | s 4 299 | f 32/39/6 34/45/6 36/44/6 300 | f 32/39/6 30/40/6 34/45/6 301 | s 2 302 | f 34/42/19 37/46/4 38/47/4 303 | f 34/42/19 33/41/19 37/46/4 304 | s 4 305 | f 33/41/3 39/48/3 37/46/3 306 | f 33/41/3 35/43/3 39/48/3 307 | s 2 308 | f 35/43/20 40/49/1 39/48/1 309 | f 35/43/20 36/44/20 40/49/1 310 | s 4 311 | f 36/44/6 38/50/6 40/49/6 312 | f 36/44/6 34/45/6 38/50/6 313 | s 2 314 | f 38/47/4 41/51/5 42/52/5 315 | f 38/47/4 37/46/4 41/51/5 316 | s 4 317 | f 37/46/3 43/53/3 41/51/3 318 | f 37/46/3 39/48/3 43/53/3 319 | s 2 320 | f 39/48/1 44/54/2 43/53/2 321 | f 39/48/1 40/49/1 44/54/2 322 | s 4 323 | f 40/49/6 42/55/6 44/54/6 324 | f 40/49/6 38/50/6 42/55/6 325 | s 2 326 | f 42/52/5 45/56/8 46/57/8 327 | f 42/52/5 41/51/5 45/56/8 328 | s 4 329 | f 41/51/3 47/58/3 45/56/3 330 | f 41/51/3 43/53/3 47/58/3 331 | s 2 332 | f 43/53/2 48/59/7 47/58/7 333 | f 43/53/2 44/54/2 48/59/7 334 | s 4 335 | f 44/54/6 46/60/6 48/59/6 336 | f 44/54/6 42/55/6 46/60/6 337 | s 2 338 | f 46/57/8 49/61/10 50/62/10 339 | f 46/57/8 45/56/8 49/61/10 340 | s 4 341 | f 45/56/3 51/63/3 49/61/3 342 | f 45/56/3 47/58/3 51/63/3 343 | s 2 344 | f 47/58/7 52/64/9 51/63/9 345 | f 47/58/7 48/59/7 52/64/9 346 | s 4 347 | f 48/59/6 50/65/6 52/64/6 348 | f 48/59/6 46/60/6 50/65/6 349 | s 2 350 | f 50/62/10 53/66/12 54/67/12 351 | f 50/62/10 49/61/10 53/66/12 352 | s 4 353 | f 49/61/3 55/68/3 53/66/3 354 | f 49/61/3 51/63/3 55/68/3 355 | s 2 356 | f 51/63/9 56/69/11 55/68/11 357 | f 51/63/9 52/64/9 56/69/11 358 | s 4 359 | f 52/64/6 54/70/6 56/69/6 360 | f 52/64/6 50/65/6 54/70/6 361 | s 2 362 | f 54/67/12 57/71/14 58/72/14 363 | f 54/67/12 53/66/12 57/71/14 364 | s 4 365 | f 53/66/3 59/73/3 57/71/3 366 | f 53/66/3 55/68/3 59/73/3 367 | s 2 368 | f 55/68/11 60/74/13 59/73/13 369 | f 55/68/11 56/69/11 60/74/13 370 | s 4 371 | f 56/69/6 58/75/6 60/74/6 372 | f 56/69/6 54/70/6 58/75/6 373 | s 2 374 | f 58/72/14 61/76/16 62/77/16 375 | f 58/72/14 57/71/14 61/76/16 376 | s 4 377 | f 57/71/3 63/78/3 61/76/3 378 | f 57/71/3 59/73/3 63/78/3 379 | s 2 380 | f 59/73/13 64/79/15 63/78/15 381 | f 59/73/13 60/74/13 64/79/15 382 | s 4 383 | f 60/74/6 62/80/6 64/79/6 384 | f 60/74/6 58/75/6 62/80/6 385 | s 2 386 | f 62/77/16 65/81/18 66/82/18 387 | f 62/77/16 61/76/16 65/81/18 388 | s 4 389 | f 61/76/3 67/83/3 65/81/3 390 | f 61/76/3 63/78/3 67/83/3 391 | s 2 392 | f 63/78/15 68/84/17 67/83/17 393 | f 63/78/15 64/79/15 68/84/17 394 | s 4 395 | f 64/79/6 66/85/6 68/84/6 396 | f 64/79/6 62/80/6 66/85/6 397 | s 2 398 | f 66/82/18 69/86/20 70/87/20 399 | f 66/82/18 65/81/18 69/86/20 400 | s 4 401 | f 65/81/3 71/88/3 69/86/3 402 | f 65/81/3 67/83/3 71/88/3 403 | s 2 404 | f 67/83/17 72/89/19 71/88/19 405 | f 67/83/17 68/84/17 72/89/19 406 | s 4 407 | f 68/84/6 70/90/6 72/89/6 408 | f 68/84/6 66/85/6 70/90/6 409 | s 2 410 | f 70/87/20 4/91/1 1/92/1 411 | f 70/87/20 69/86/20 4/91/1 412 | s 4 413 | f 69/86/3 6/93/3 4/91/3 414 | f 69/86/3 71/88/3 6/93/3 415 | s 2 416 | f 71/88/19 8/94/4 6/93/4 417 | f 71/88/19 72/89/19 8/94/4 418 | s 4 419 | f 72/89/6 1/95/6 8/94/6 420 | f 72/89/6 70/90/6 1/95/6 421 | # 144 faces 422 | 423 | -------------------------------------------------------------------------------- /editor/meshes/z-scale-axis.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 20.11.2017 11:47:36 3 | 4 | mtllib z-scale-axis.mtl 5 | 6 | # 7 | o z_scale_axis 8 | # 9 | 10 | v -2.7510 -2.3861 55.6378 11 | v -2.7510 -1.8861 55.6378 12 | v -3.2510 -1.8861 55.6378 13 | v -3.2510 -2.3861 55.6378 14 | v -2.7510 -2.3861 4.7053 15 | v -3.2510 -2.3861 4.7053 16 | v -3.2510 -1.8861 4.7053 17 | v -2.7510 -1.8861 4.7053 18 | v 6.9118 -12.1791 60.9683 19 | v 6.9118 7.8209 60.9683 20 | v -13.0882 7.8209 60.9683 21 | v -13.0882 -12.1791 60.9683 22 | v 6.9118 -12.1791 57.4123 23 | v -13.0882 -12.1791 57.4123 24 | v -13.0882 7.8209 57.4123 25 | v 6.9118 7.8209 57.4123 26 | # 16 vertices 27 | 28 | vn 0.0000 0.0000 1.0000 29 | vn -0.0000 -0.0000 -1.0000 30 | vn -0.0000 -1.0000 0.0000 31 | vn -1.0000 0.0000 0.0000 32 | vn 0.0000 1.0000 -0.0000 33 | vn 1.0000 -0.0000 -0.0000 34 | # 6 vertex normals 35 | 36 | vt 0.0000 0.0000 0.0000 37 | vt 1.0000 0.0000 0.0000 38 | vt 1.0000 1.0000 0.0000 39 | vt 0.0000 1.0000 0.0000 40 | # 4 texture coords 41 | 42 | g z_scale_axis 43 | usemtl 01___Default 44 | s 2 45 | f 1/1/1 2/2/1 3/3/1 46 | f 3/3/1 4/4/1 1/1/1 47 | s 4 48 | f 5/1/2 6/2/2 7/3/2 49 | f 7/3/2 8/4/2 5/1/2 50 | s 8 51 | f 1/1/3 4/2/3 6/3/3 52 | f 6/3/3 5/4/3 1/1/3 53 | s 16 54 | f 4/1/4 3/2/4 7/3/4 55 | f 7/3/4 6/4/4 4/1/4 56 | s 32 57 | f 3/1/5 2/2/5 8/3/5 58 | f 8/3/5 7/4/5 3/1/5 59 | s 64 60 | f 2/1/6 1/2/6 5/3/6 61 | f 5/3/6 8/4/6 2/1/6 62 | s 2 63 | f 9/1/1 10/2/1 11/3/1 64 | f 11/3/1 12/4/1 9/1/1 65 | s 4 66 | f 13/1/2 14/2/2 15/3/2 67 | f 15/3/2 16/4/2 13/1/2 68 | s 8 69 | f 9/1/3 12/2/3 14/3/3 70 | f 14/3/3 13/4/3 9/1/3 71 | s 16 72 | f 12/1/4 11/2/4 15/3/4 73 | f 15/3/4 14/4/4 12/1/4 74 | s 32 75 | f 11/1/5 10/2/5 16/3/5 76 | f 16/3/5 15/4/5 11/1/5 77 | s 64 78 | f 10/1/6 9/2/6 13/3/6 79 | f 13/3/6 16/4/6 10/1/6 80 | # 24 faces 81 | 82 | -------------------------------------------------------------------------------- /editor/node_helper.py: -------------------------------------------------------------------------------- 1 | import math 2 | from textwrap import dedent 3 | from editor.editor_manager import Move, Scale, Rotate, Create, Remove 4 | from kivy.properties import BooleanProperty, ListProperty, ObjectProperty, NumericProperty, StringProperty 5 | 6 | class NodeHelper(object): 7 | meshes = [] 8 | pos = [0, 0, 0] 9 | rot = [0, 0, 0] 10 | scale = [1, 1, 1] 11 | current_rot = [0, 0, 0] 12 | 13 | def __init__(self): 14 | self.pos = [0.01, 0.01, 0.01] 15 | self.meshes = [] 16 | self.rot = [0.01, 0.01, 0.01] 17 | self.scale = [0.01, 0.01, 0.01] 18 | self.current_rotrot = [0.01, 0.01, 0.01] 19 | self.current_mesh = None 20 | self.last_op = 0 21 | 22 | def add_mesh(self, mesh): 23 | self.meshes += [[ 24 | mesh, 25 | mesh.translate[:], 26 | mesh.rotate[:], 27 | mesh.scale[:] 28 | ]] 29 | 30 | def save_command(self, last_op=0, layout3d=None, callback=None): 31 | self.last_op = last_op 32 | if self.last_op == 0 and self.current_mesh: 33 | self.editor_manager.add_command(Move(self.current_mesh, self.current_mesh.translate)) 34 | elif self.last_op == 1 and self.current_mesh: 35 | self.editor_manager.add_command(Scale(self.current_mesh, self.current_mesh.scale)) 36 | elif self.last_op == 2 and self.current_mesh: 37 | self.editor_manager.add_command(Rotate(self.current_mesh, [self.current_mesh.pitch, 38 | self.current_mesh.yaw, self.current_mesh.roll])) 39 | elif self.last_op == 3 and self.current_mesh: 40 | self.editor_manager.add_command(Create(self.current_mesh, layout3d)) 41 | elif self.last_op == 4 and self.current_mesh: 42 | self.editor_manager.add_command(Remove(self.current_mesh, layout3d, callback)) 43 | 44 | def save_current_state(self): 45 | self.current_rot = self.rot[:] 46 | self.current_pos = self.pos[:] 47 | self.current_scale = self.scale[:] 48 | 49 | def add_command(self, command): 50 | if self.current_mesh: 51 | self.editor_manager.add_command(command) 52 | 53 | def move_to(self, pos): 54 | self.pos = pos 55 | for e in self.meshes: 56 | c_t = e[1] 57 | c_t = [c_t[0] + pos[0], c_t[1] + pos[1], c_t[2] + pos[2]] 58 | e[0].translate = c_t[:] 59 | if self.current_mesh: 60 | self.current_mesh.translate = pos[:] 61 | self.last_op = 0 62 | 63 | def set_scale(self, scale): 64 | self.scale = scale 65 | for i in range(0, 3): 66 | if self.scale[i] <= 0: 67 | self.scale[i] = 0.01 68 | print(self.scale) 69 | 70 | #for e in self.meshes: 71 | # c_t = e[3] 72 | # c_t = [c_t[0] + scale[0], c_t[1] + scale[1], c_t[2] + scale[2]] 73 | # e[0].scale = c_t[:] 74 | if self.current_mesh: 75 | self.current_mesh.scale = self.scale[:] 76 | self.last_op = 1 77 | 78 | def yaw(self, value): 79 | rot = self.rot 80 | x = value 81 | y = value 82 | #z = value * math.cos(rot[0])*math.sin(rot[2]) 83 | 84 | #rot[0] += x*2 85 | #rot[1] += y*2 86 | rot[1] += x*2 87 | if rot[1] > 180: 88 | rot[1] = -180 + (rot[1]-180) 89 | elif rot[1] < -180: 90 | rot[1] = 180 + (180 - rot[1]) 91 | 92 | 93 | 94 | if self.current_mesh: 95 | self.current_mesh.axis_type = 1 96 | self.rotate(rot) 97 | 98 | def pitch(self, value): 99 | rot = self.rot 100 | x = value 101 | y = value 102 | z = value * math.cos(rot[1])*math.sin(rot[2]) 103 | 104 | #rot[0] += x*2 105 | #rot[1] += y*2 106 | rot[0] += y*2 107 | if rot[0] > 180: 108 | rot[0] = -180 + (rot[0]-180) 109 | elif rot[0] < -180: 110 | rot[0] = 180 + (180 - rot[0]) 111 | 112 | if self.current_mesh: 113 | self.current_mesh.axis_type = 0 114 | self.rotate(rot) 115 | 116 | def roll(self, value): 117 | rot = self.rot 118 | current_rot = self.current_rot 119 | 120 | 121 | #x = rad * math.sin(azimuth) * math.sin(polar) 122 | #y = rad * math.cos(polar) 123 | #z = rad * math.cos(azimuth) * math.sin(polar) 124 | 125 | z = math.sin( math.radians(current_rot[0]) ) * value + math.sin( math.radians(current_rot[1]) ) * value 126 | x = math.sin( math.radians(current_rot[1]) ) * value + math.sin( math.radians(current_rot[2]) ) * value 127 | y = math.cos(math.radians(current_rot[2])) * value 128 | 129 | #rot[0] += x 130 | #rot[1] += y 131 | #rot[2] += z 132 | rot[2] += value 133 | if rot[2] > 180: 134 | rot[2] = -180 + (rot[2]-180) 135 | elif rot[2] < -180: 136 | rot[2] = 180 + (180 - rot[2]) 137 | 138 | if self.current_mesh: 139 | self.current_mesh.axis_type = 2 140 | self.rotate(rot) 141 | 142 | def rotate(self, rot): 143 | self.rot = rot 144 | if self.current_mesh: 145 | self.move_to(self.pos) 146 | self.current_mesh.pitch = rot[0] 147 | self.current_mesh.yaw = rot[1] 148 | self.current_mesh.roll = rot[2] 149 | #for e in self.meshes[6:9]: 150 | # e[0].pitch = rot[0] 151 | # e[0].yaw = rot[1] 152 | # e[0].roll = rot[2] 153 | for e in self.meshes[3:6]: 154 | e[0].pitch = rot[0] 155 | e[0].yaw = rot[1] 156 | e[0].roll = rot[2] 157 | self.last_op = 2 158 | -------------------------------------------------------------------------------- /editor/space_editor.py: -------------------------------------------------------------------------------- 1 | import math 2 | from kivy.lang import Builder 3 | from textwrap import dedent 4 | from .node_helper import NodeHelper 5 | from kivy.properties import ObjectProperty 6 | 7 | class SpaceEditor: 8 | def __init__(self, layout, parent, editor_manager): 9 | self.layout = layout 10 | self.parent = parent 11 | self.node_helper = NodeHelper() 12 | self.node_helper.editor_manager = editor_manager 13 | axis = ''' 14 | Node: 15 | translate: (0, 0, 0) 16 | scale: (0.05, 0.05, 0.05) 17 | min_light_intensity: 0.8 18 | alpha: 0.5 19 | always_on_top: True 20 | receive_shadows: False 21 | meshes: ("{0}",) 22 | Button: 23 | id: c_button 24 | text: "Hello" 25 | background_normal: "{1}" 26 | ''' 27 | 28 | meshes = ["./editor/meshes/x-rot-axis.obj", "./editor/meshes/y-rot-axis.obj", "./editor/meshes/z-rot-axis.obj", 29 | "./editor/meshes/x-scale-axis.obj", "./editor/meshes/z-scale-axis.obj", "./editor/meshes/y-scale-axis.obj", 30 | "./editor/meshes/x-axis.obj", "./editor/meshes/z-axis.obj", "./editor/meshes/y-axis.obj"] 31 | 32 | colors = ["./editor/images/red.png", "./editor/images/green.png", "./editor/images/blue.png", 33 | "./editor/images/green.png", "./editor/images/blue.png", "./editor/images/red.png", 34 | "./editor/images/red.png", "./editor/images/green.png", "./editor/images/blue.png"] 35 | 36 | for i, e in enumerate(meshes): 37 | node = Builder.load_string(dedent(axis.format(e, colors[i]))) 38 | node.ids.c_button.bind(on_touch_down=parent.on_button_touch_down) 39 | node.ids.c_button.bind(on_touch_up=parent.on_button_touch_up) 40 | node.ids.c_button.bind(on_touch_move=parent.on_button_touch_move) 41 | node.ids.c_button.c_id = i 42 | layout.add_widget(node) 43 | self.node_helper.add_mesh(node) 44 | 45 | def free(self): 46 | for e in self.node_helper.meshes: 47 | self.layout.remove_widget(e[0]) 48 | 49 | 50 | -------------------------------------------------------------------------------- /example.py: -------------------------------------------------------------------------------- 1 | from kivy.app import App 2 | from kivy.uix.button import Button 3 | from kivy.uix.floatlayout import FloatLayout 4 | from kivy.uix.rst import RstDocument 5 | 6 | doc = ''' 7 | * An Example. 8 | * Layout3D for Kivy Widgets. 9 | * More to come. 10 | * If you want to help develop this project mail me: kpiorno@gmail.com 11 | ''' 12 | 13 | class ExampleApp(App): 14 | def build(self): 15 | self.m_doc = doc 16 | from kivy.lang import Builder 17 | root = Builder.load_string(''' 18 | #:kivy 1.0 19 | #: import Layout3D kivy3dgui.layout3d 20 | #: import Animation kivy.animation.Animation 21 | Layout3D: 22 | id: par 23 | size_hint: (1.0, 1.0) 24 | canvas_size: (1366, 768) 25 | post_processing: False 26 | Node: 27 | id: Node1 28 | name: 'Node 0' 29 | rotate: (90, 0.3, 1, 0) 30 | scale: (0.4, 0.4, 0.4) 31 | translate: (20, -10.0, -110) 32 | effect: True 33 | meshes: ("./data/obj/sphere.obj", ) 34 | FloatLayout: 35 | canvas: 36 | Color: 37 | rgb: 1, 1, 1,0.1 38 | Rectangle: 39 | size: self.size 40 | pos: self.pos 41 | source: "./data/imgs/background.jpg" 42 | size_hint: (1.0, 1.0) 43 | Button: 44 | #size_hint: (0.2, 0.2) 45 | pos_hint: {"x":0, "y":0 } 46 | size_hint: (None, None) 47 | text: "Hello" 48 | 49 | Button: 50 | size_hint: (0.3, 0.3) 51 | text: "Rotate" 52 | 53 | Button: 54 | size_hint: (0.2, 0.2) 55 | pos_hint: {"x":0.0, "y":0.6} 56 | text: "GO!!!" 57 | font_size: 50 58 | on_release: 59 | Animation.cancel_all(FirstWindow) 60 | Animation.cancel_all(SecondWindow) 61 | Animation(rotate=(-60, 0, 1.0, 0.0), scale=(1, 1, 1), duration=4.3).start(SecondWindow) 62 | Animation(rotate=(7, 0, 1.0, 0.0), translate=(-240, -80, 380), duration=10.3).start(FirstWindow) 63 | 64 | TextInput: 65 | id: TextSphere 66 | text: "Please write or write please?" 67 | size_hint: (0.8, 0.4) 68 | on_focus: 69 | if args[1]: Animation(translate= (10, -10.0, -70), rotate=(95, 0, 1.0, -0.3), 70 | duration=0.3).start(Node1) 71 | if not args[1]: Animation(translate= (20, -10.0, -90), rotate= (90, 0.3, 1, 0), 72 | duration=0.3).start(Node1) 73 | font_size: 40 74 | 75 | Node: 76 | id: SecondWindow 77 | name: 'Node 1' 78 | scale: (0.01, 0.01, 0.01) 79 | translate: (95, 0, -180) 80 | effect: True 81 | meshes: ("./data/obj/2dbox.obj",) 82 | FloatLayout: 83 | id: float 84 | canvas: 85 | Color: 86 | rgb: 1, 1, 1 87 | Rectangle: 88 | size: self.size 89 | pos: self.pos 90 | source: "./data/imgs/background.jpg" 91 | size_hint: (1.0, 1.0) 92 | RstDocument: 93 | size_hint: (1.0, 1.0) 94 | pos_hint: {"x": 0.00, "y": 0.00} 95 | text: app.m_doc 96 | Node: 97 | id: FirstWindow 98 | name: 'Node 1' 99 | rotate: (10, 0, 1, 0) 100 | scale: (1, 0.7, 1) 101 | translate: (0, 0, -140) 102 | effect: True 103 | meshes: ("./data/obj/2dbox.obj",) 104 | FloatLayout: 105 | canvas: 106 | Color: 107 | rgb: 1, 1, 1 108 | Rectangle: 109 | size: self.size 110 | pos: self.pos 111 | source: "./data/imgs/background.jpg" 112 | size_hint: (1.0, 1.0) 113 | RstDocument: 114 | size_hint: (0.3, 0.98) 115 | pos_hint: {"x": 0.7, "y": 0.01} 116 | text: app.m_doc 117 | 118 | GridLayout: 119 | cols: 2 120 | pos_hint: {"x": 0.4, "y": 0.1} 121 | 122 | size_hint: (0.28, 0.5) 123 | GridLayout: 124 | cols: 2 125 | Label: 126 | text: "Effect" 127 | font_size: 40 128 | 129 | CheckBox: 130 | text: 'Disable' 131 | active: False 132 | on_active: par.post_processing = self.active 133 | Spinner: 134 | values: ["A","B"] 135 | Button: 136 | size_hint: (0.3, 1.0) 137 | text: "Dummy Button!!!" 138 | 139 | 140 | TextInput: 141 | Label: 142 | size_hint: (0.3, 1.0) 143 | text: "Kivy 3D, Enjoy it!!!" 144 | 145 | 146 | Image: 147 | size_hint: (0.26, 0.8) 148 | pos_hint: {"x": 0.1, "y": 0.1} 149 | source: "./data/imgs/faust_github.jpg" 150 | 151 | Button: 152 | size_hint: (0.1, 0.05) 153 | pos_hint: {"x": 0.5, "y": 0.8} 154 | text: "Rotate" 155 | on_release: 156 | Animation.cancel_all(FirstWindow) 157 | (Animation(rotate=(30, 0, 1, 0), duration=4.0, t="out_bounce") + Animation(rotate=(10, 0, 1, 0), 158 | duration=4.0, t="out_bounce")).start(FirstWindow) 159 | 160 | Slider: 161 | size_hint: (0.3, 0.1) 162 | pos_hint: {"x": 0.4, "y": 0.6} 163 | text: "Spinx" 164 | 165 | Label: 166 | size_hint: (0.3, 0.3) 167 | pos_hint: {"x": 0.4, "y": 0.62} 168 | text: TextSphere.text 169 | Node: 170 | id: SecondWindowA 171 | name: 'Node 1' 172 | rotate: (7, 0, 1, 0) 173 | scale: (20, 20, 20) 174 | translate: (-240, -80, 380) 175 | effect: True 176 | FloatLayout: 177 | canvas: 178 | Color: 179 | rgb: 1, 1, 1 180 | Rectangle: 181 | size: self.size 182 | pos: self.pos 183 | source: "./data/imgs/imgback.jpg" 184 | size_hint: (1.0, 1.0) 185 | RstDocument: 186 | size_hint: (0.3, 0.98) 187 | pos_hint: {"x": 0.01, "y": 0.01} 188 | text: app.m_doc 189 | 190 | 191 | ''') 192 | self.root = root 193 | return root 194 | 195 | 196 | if __name__ == '__main__': 197 | ExampleApp().run() 198 | -------------------------------------------------------------------------------- /example2.py: -------------------------------------------------------------------------------- 1 | from kivy.app import App 2 | from kivy.uix.button import Button 3 | from kivy.uix.floatlayout import FloatLayout 4 | from kivy.lang import Builder 5 | 6 | 7 | class ExampleApp(App): 8 | def build(self): 9 | root = Builder.load_string(''' 10 | #:kivy 1.0 11 | #: import Layout3D kivy3dgui.layout3d 12 | #: import Animation kivy.animation.Animation 13 | Layout3D: 14 | id: par 15 | size_hint: (1.0, 1.0) 16 | post_processing: True 17 | Node: 18 | id: Node1 19 | name: 'Node 0' 20 | rotate: (-20, 0, 1, 0) 21 | scale: (1.0, 1.0, 1.0) 22 | translate: (0, -20.0, -50) 23 | effect: True 24 | meshes: ("./data/obj/athene.obj", ) 25 | FloatLayout: 26 | canvas: 27 | Color: 28 | rgb: 1, 1, 1,0.1 29 | Rectangle: 30 | size: self.size 31 | pos: self.pos 32 | source: "./data/imgs/terr_rock6.jpg" 33 | 34 | on_touch_up: self.parent.fbo.texture.save("./data/imgs/imgback.jpg") 35 | 36 | GridLayout: 37 | cols: 4 38 | Label: 39 | text: "Click me" 40 | 41 | Label: 42 | text: "Click me 2" 43 | 44 | Label: 45 | text: "Click me 3" 46 | 47 | Switch: 48 | text: "Click me" 49 | 50 | Slider: 51 | 52 | GridLayout: 53 | cols: 1 54 | Label: 55 | TextInput: 56 | pos_hint: {"x": 0.1, "y": 0.1} 57 | size_hint: (0.9, 0.3) 58 | font_size: 20 59 | text: "Nombre" 60 | on_focus: 61 | if args[1]: Animation(translate=(0, -10.0, -12), rotate=(-45, 0., 1., 0.), 62 | duration=0.3).start(Node1) 63 | if not args[1]: Animation(translate=(0, -20.0, -50), rotate=(-20, 0, 1, 0), 64 | duration=0.3).start(Node1) 65 | Label: 66 | 67 | GridLayout: 68 | cols: 1 69 | TextInput: 70 | text: "Testing 1" 71 | TextInput: 72 | text: "Testing 2" 73 | TextInput: 74 | text: "Testing 3" 75 | font_size: 30 76 | on_focus: 77 | if args[1]: Animation(translate=(0, -3.0, -10), rotate=(35, 0., 1., 0.), 78 | duration=0.3).start(Node1) 79 | if not args[1]: Animation(translate=(0, -20.0, -50), rotate=(-20, 0, 1, 0), 80 | duration=0.3).start(Node1) 81 | 82 | 83 | AsyncImage: 84 | pos_hint: {"x":0.6, "y": 0.3} 85 | size_hint: (0.4, 0.3) 86 | allow_strecht: True 87 | source: "./data/imgs/imgback.jpg" 88 | 89 | CheckBox: 90 | text: 'Disable' 91 | active: True 92 | size_hint: 0.3, 0.3 93 | on_active: par.post_processing = self.active 94 | ''') 95 | self.root = root 96 | return root 97 | 98 | 99 | if __name__ == '__main__': 100 | ExampleApp().run() 101 | -------------------------------------------------------------------------------- /kivy3dgui/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'kpiorno' 2 | -------------------------------------------------------------------------------- /kivy3dgui/fbowidget.py: -------------------------------------------------------------------------------- 1 | ''' 2 | FBO example 3 | =========== 4 | 5 | This is an example of how to use FBO (Frame Buffer Object) to speedup graphics. 6 | An Fbo is like a texture that you can draw on it. 7 | 8 | By default, all the children are added in the canvas of the parent. 9 | When you are displaying thousand of widget, you'll do thousands of graphics 10 | instructions each frame. 11 | The idea is to do this drawing only one time in a Fbo, and then, draw the Fbo 12 | every frame instead of all children's graphics instructions. 13 | 14 | We created a FboFloatLayout that create his canvas, and a Fbo. 15 | After the Fbo is created, we are adding Color and Rectangle instruction to 16 | display the texture of the Fbo itself. 17 | The overload of on_pos/on_size are here to update size of Fbo if needed, and 18 | adapt the position/size of the rectangle too. 19 | 20 | Then, when a child is added or removed, we are redirecting addition/removal of 21 | graphics instruction to our Fbo. This is why add_widget/remove_widget are 22 | overloaded too. 23 | 24 | .. note:: 25 | 26 | This solution can be helpful but not ideal. Multisampling are not available 27 | in Framebuffer. We will work to add the support of it if the hardware is 28 | capable of, but it could be not the same. 29 | 30 | ''' 31 | 32 | 33 | # needed to create Fbo, must be resolved in future kivy version 34 | from kivy.core.window import Window 35 | 36 | from kivy.graphics import Color, Rectangle, Canvas, Callback 37 | from kivy.graphics.fbo import Fbo 38 | from kivy.uix.floatlayout import FloatLayout 39 | from kivy.properties import ObjectProperty, BooleanProperty 40 | from kivy.resources import resource_find 41 | from kivy.graphics.opengl import * 42 | from kivy.graphics import * 43 | from kivy.graphics.texture import Texture 44 | 45 | 46 | class FboFloatLayout(FloatLayout): 47 | 48 | texture = ObjectProperty(None, allownone=True) 49 | 50 | alpha_blending = BooleanProperty(False) 51 | 52 | def __init__(self, **kwargs): 53 | self.canvas = Canvas() 54 | with self.canvas.before: 55 | Callback(self._set_blend_func) 56 | #self.size 57 | self.fbo_texture = Texture.create(size=self.size, 58 | colorfmt='rgba') 59 | 60 | self.fbo_texture.mag_filter = 'linear' 61 | self.fbo_texture.min_filter = 'linear' 62 | 63 | with self.canvas: 64 | #self.cbs = Callback(self.prepare_canvas) 65 | 66 | self.fbo = Fbo(size=self.size, texture=self.fbo_texture) 67 | #Color(0, 0, 0, 1) 68 | #self.fbo_rect = Rectangle(size=self.size) 69 | 70 | 71 | with self.fbo: 72 | ClearColor(0.0, 0.0, 0.0, 1.0) 73 | ClearBuffers() 74 | self.fbo_rect = Rectangle(size=self.size) 75 | 76 | 77 | #self.fbo.shader.source = resource_find('./kivy3dgui/gles2.0/shaders/invert.glsl') 78 | #with self.fbo.after: 79 | # self.cbr = Callback(self.reset_gl_context) 80 | # PopMatrix() 81 | 82 | with self.canvas.before: 83 | Callback(self._set_blend_func) 84 | 85 | # wait that all the instructions are in the canvas to set texture 86 | 87 | self.texture = self.fbo.texture 88 | try: 89 | self.size = kwargs.pop("size") 90 | self.size_hint = kwargs.pop("size_hint") 91 | self.clear_color = kwargs.pop("clear_color") 92 | super(FboFloatLayout, self).__init__(**kwargs) 93 | except: 94 | print(kwargs) 95 | 96 | def prepare_canvas(self, *args): 97 | glEnable(GL_BLEND) 98 | glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE) 99 | glEnable(GL_DEPTH_TEST) 100 | 101 | def _set_blend_func(self, instruction): 102 | # clobber the blend mode 103 | if self.alpha_blending: 104 | glBlendFunc(GL_ONE, 105 | GL_ZERO) 106 | else: 107 | glBlendFunc(GL_SRC_ALPHA, 108 | GL_ONE_MINUS_SRC_ALPHA) 109 | 110 | 111 | glDisable(GL_CULL_FACE) 112 | self.fbo.draw() 113 | 114 | glBlendFunc(GL_SRC_ALPHA, 115 | GL_ONE_MINUS_SRC_ALPHA) 116 | 117 | def setup_gl_context(self, *args): 118 | glEnable(GL_BLEND) 119 | glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) 120 | glEnable(GL_DEPTH_TEST) 121 | 122 | def reset_gl_context(self, *args): 123 | glDisable(GL_DEPTH_TEST) 124 | glDisable(GL_CULL_FACE) 125 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) 126 | 127 | 128 | def add_widget(self, *largs): 129 | # trick to attach kivy3dgui instructino to fbo instead of canvas 130 | canvas = self.canvas 131 | self.canvas = self.fbo 132 | ret = super(FboFloatLayout, self).add_widget(*largs) 133 | self.canvas = canvas 134 | return ret 135 | 136 | def remove_widget(self, *largs): 137 | canvas = self.canvas 138 | self.canvas = self.fbo 139 | super(FboFloatLayout, self).remove_widget(*largs) 140 | self.canvas = canvas 141 | 142 | def on_size(self, instance, value): 143 | self.fbo.size = value 144 | self.texture = self.fbo_texture 145 | self.fbo_rect.size = value 146 | 147 | def on_pos(self, instance, value): 148 | self.fbo_rect.pos = value 149 | 150 | def on_texture(self, instance, value): 151 | self.fbo_rect.texture = value 152 | 153 | def on_touch_down(self, touch): 154 | return super(FboFloatLayout, self).on_touch_down(touch) 155 | 156 | def on_touch_move(self, touch): 157 | return super(FboFloatLayout, self).on_touch_move(touch) 158 | 159 | """def on_touch_up(self, touch): 160 | return super(FboFloatLayout, self).on_touch_up(touch)""" 161 | 162 | def on_touch_up(self, touch): 163 | for e in self.children: 164 | if e.collide_point(touch.x, touch.y): 165 | return e.on_touch_up(touch) 166 | 167 | 168 | if __name__ == '__main__': 169 | from kivy.uix.button import Button 170 | from kivy.app import App 171 | 172 | class TestFboApp(App): 173 | def build(self): 174 | 175 | # test with FboFloatLayout or FloatLayout 176 | # comment/uncomment to test it 177 | root = FboFloatLayout() 178 | #root = FloatLayout() 179 | 180 | # this part of creation can be slow. try to optimize the loop a 181 | # little bit. 182 | s = 30 183 | size = (s, s) 184 | sh = (None, None) 185 | add = root.add_widget 186 | print('Creating 5000 widgets...') 187 | for i in range(5000): 188 | x = (i % 40) * s 189 | y = int(i / 40) * s 190 | add(Button(text=str(i), pos=(x, y), size_hint=sh, size=size)) 191 | if i % 1000 == 1000 - 1: 192 | print(5000 - i - 1, 'left...') 193 | 194 | return root 195 | 196 | TestFboApp().run() 197 | 198 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/dop.glsl: -------------------------------------------------------------------------------- 1 | ---VERTEX SHADER------------------------------------------------------- 2 | #ifdef GL_ES 3 | precision highp float; 4 | #endif 5 | 6 | attribute vec3 v_pos; 7 | attribute vec4 blendIndices; 8 | attribute vec4 blendWeights; 9 | 10 | uniform mat4 modelview_mat; 11 | uniform mat4 projection_mat; 12 | uniform mat4 depthMVP; 13 | 14 | 15 | varying vec3 speed; 16 | varying vec4 m_pos; 17 | uniform float id; 18 | 19 | vec3 getSpeed() 20 | { 21 | return vec3(0.0, 0.0, 0.0); 22 | //return vec3(normalize(v), norm); 23 | } 24 | 25 | 26 | 27 | void main (void) { 28 | //compute vertex position in eye_sapce and normalize normal vector 29 | //projection_mat = mat4(0.750, 0,0,0,0,1,0,0,0,0,-1.003,-1,0,0,-2.00,0.0); 30 | vec4 pos = modelview_mat * vec4(v_pos,1.0); 31 | 32 | pos = projection_mat * pos; 33 | 34 | gl_Position = pos; 35 | m_pos = pos; 36 | 37 | } 38 | 39 | 40 | ---FRAGMENT SHADER----------------------------------------------------- 41 | #ifdef GL_ES 42 | precision highp float; 43 | #endif 44 | 45 | 46 | uniform float cast_shadows; 47 | uniform float id; 48 | // Ouput data 49 | //layout(location = 0) out float fragmentdepth; 50 | 51 | varying vec3 speed; 52 | vec3 getSpeedColor() 53 | { 54 | //return vec3(0.5 + 0.5 * speed, 0.); 55 | return vec3(0.5 + 0.5 * speed.xy, pow(speed.z, 0.5)); 56 | } 57 | 58 | varying vec4 m_pos; 59 | 60 | void main(){ 61 | // Not really needed, OpenGL does it anyway 62 | //fragmentdepth = gl_FragCoord.z; 63 | //if (int(id) > 2) 64 | // return; 65 | gl_FragColor.x = 1.0-390.0/m_pos.w; 66 | gl_FragColor.y = 1.0-390.0/m_pos.w; 67 | gl_FragColor.z = 1.0-390.0/m_pos.w; 68 | gl_FragColor.a = 1.0-1.0; 69 | //gl_FragColor.xyz = getSpeedColor(); 70 | gl_FragColor.a = 1.0; 71 | //if (cast_shadows==0) gl_FragColor.a = 1.0; 72 | //gl_FragColor = vec4(gl_FragCoord.z); 73 | } 74 | 75 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/invert.glsl: -------------------------------------------------------------------------------- 1 | ---VERTEX SHADER------------------------------------------------------- 2 | #ifdef GL_ES 3 | precision highp float; 4 | #endif 5 | 6 | $HEADER$ 7 | void main (void) { 8 | frag_color = color * vec4(1.0, 1.0, 1.0, opacity); 9 | tex_coord0 = vTexCoords0; 10 | gl_Position = projection_mat * modelview_mat * vec4(vPosition.xy, 0.0, 1.0); 11 | } 12 | 13 | 14 | ---FRAGMENT SHADER----------------------------------------------------- 15 | #ifdef GL_ES 16 | precision highp float; 17 | #endif 18 | 19 | $HEADER$ 20 | void main (void){ 21 | //vec3 col = vec3(1.0, 1.0, 1.0) - (frag_color * texture2D(texture0, tex_coord0)).xyz; 22 | vec4 col = (frag_color * texture2D(texture0, tex_coord0)); 23 | vec4 final_color = vec4(1.0 - col.xyz, col.a); 24 | //vec4 final_color = vec4(col.xyz, col.a); 25 | 26 | 27 | if (final_color.a < 0.1) 28 | final_color = vec4(0.0, 0.0, 0.0, 0.0); 29 | //final_color.a += 0.0004; 30 | gl_FragColor = final_color; 31 | } 32 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/legacy.glsl: -------------------------------------------------------------------------------- 1 | /* simple.glsl 2 | 3 | simple diffuse lighting based on laberts cosine law; see e.g.: 4 | http://en.wikipedia.org/wiki/Lambertian_reflectance 5 | http://en.wikipedia.org/wiki/Lambert%27s_cosine_law 6 | */ 7 | ---VERTEX SHADER------------------------------------------------------- 8 | #ifdef GL_ES 9 | precision highp float; 10 | #endif 11 | 12 | attribute vec3 v_pos; 13 | attribute vec3 v_normal; 14 | attribute vec2 v_tc0; 15 | attribute vec3 tangent; 16 | attribute vec4 blendIndices; 17 | attribute vec4 blendWeights; 18 | 19 | 20 | uniform mat4 projection_mat; 21 | uniform mat4 camera; 22 | uniform mat4 matrix_view; 23 | uniform vec2 val_sin; 24 | uniform mat4 depthMVP; 25 | uniform float enabled_shadow; 26 | uniform float min_light_intensity; 27 | uniform mat4 normal_mat; 28 | uniform vec4 ambient_light; 29 | uniform vec4 light_intensity; 30 | uniform float light_visibility; 31 | uniform vec3 eye_position; 32 | uniform mat4 modelview_mat; 33 | uniform vec3 light_position; 34 | uniform vec3 light_orientation; 35 | uniform vec3 light_0; 36 | uniform vec3 light_1; 37 | uniform float specular_intensity; 38 | uniform float specular_power; 39 | 40 | 41 | varying mat4 modelview_mat_frag; 42 | varying vec3 eye_position_frag; 43 | varying vec3 world_vertex_pos; 44 | varying mat4 normal_mat_frag; 45 | varying vec4 normal_vec; 46 | varying vec3 vertex_pos; 47 | varying vec2 tex_coord0; 48 | varying vec3 t_tangent; 49 | varying vec4 ShadowCoord; 50 | varying vec3 Normal; 51 | varying vec4 lightPosition; 52 | varying float edge; 53 | varying vec3 L; 54 | varying vec3 N; 55 | varying vec3 light_position_frag; 56 | varying vec3 light_orientation_frag; 57 | varying vec3 light_0_frag; 58 | varying vec3 light_1_frag; 59 | varying float normal_map_enabled_frag; 60 | 61 | uniform sampler2D texture0; 62 | uniform sampler2D texture1; 63 | uniform sampler2D texture2; 64 | uniform float normal_map_enabled; 65 | 66 | mat4 depthBiasMVP = mat4(0.5, 0.0, 0.0, 0.0, 67 | 0.0, 0.5, 0.0, 0.0, 68 | 0.0, 0.0, 0.5, 0.0, 69 | 0.5, 0.5, 0.5, 1.0); 70 | 71 | mat4 M = mat4(1.0, 0.0, 0.0, 0.0, 72 | 0.0, 1.0, 0.0, 0.0, 73 | 0.0, 0.0, 1.0, 0.0, 74 | 0.0, 0.0, 0.0, 1.0); 75 | 76 | 77 | void main (void) { 78 | normal_vec = vec4(v_normal,0.0); 79 | vec4 pos = modelview_mat * vec4(v_pos,1.0); 80 | 81 | #ifdef __GLSL_CG_DATA_TYPES // Fix clipping for Nvidia and ATI 82 | gl_ClipVertex = projection_mat * gl_Vertex; 83 | #endif 84 | 85 | lightPosition = modelview_mat * vec4(0.5, 200, 0, 1); 86 | vec4 e_pos = projection_mat * camera * pos; 87 | tex_coord0 = v_tc0; 88 | ShadowCoord = depthBiasMVP*depthMVP * pos; 89 | //t_tangent = (projection_mat * camera * vec4(tangent, 1.0)).xyz; 90 | t_tangent = (normal_mat * vec4(tangent, 1.0)).xyz; 91 | 92 | normal_mat_frag = normal_mat; 93 | modelview_mat_frag = modelview_mat; 94 | eye_position_frag = (vec4(eye_position,1.0)).xyz; 95 | //eye_position_frag = ( projection_mat * camera * modelview_mat * vec4(eye_position, 1.0)).xyz; 96 | light_position_frag = light_position; 97 | light_orientation_frag = light_orientation; 98 | normal_map_enabled_frag = normal_map_enabled; 99 | world_vertex_pos = (vec4(v_pos.xyz, 1.0)).xyz; 100 | 101 | light_0_frag = light_0; 102 | light_1_frag = light_1; 103 | 104 | 105 | gl_Position = e_pos; 106 | vertex_pos = e_pos.xyz; 107 | } 108 | 109 | 110 | ---FRAGMENT SHADER----------------------------------------------------- 111 | #ifdef GL_ES 112 | precision highp float; 113 | #endif 114 | 115 | uniform vec2 cond; 116 | 117 | 118 | varying vec4 normal_vec; 119 | varying vec3 vertex_pos; 120 | varying vec2 tex_coord0; 121 | varying vec3 t_tangent; 122 | varying vec3 eye_position_frag; 123 | 124 | varying float edge; 125 | varying mat4 modelview_mat_frag; 126 | varying mat4 normal_mat_frag; 127 | 128 | uniform float alpha; 129 | uniform float enabled_shadow; 130 | uniform float min_light_intensity; 131 | uniform float lighting; 132 | uniform float flip_coords; 133 | uniform vec4 light_intensity; 134 | uniform sampler2D texture0; 135 | uniform sampler2D texture1; 136 | uniform sampler2D texture2; 137 | uniform vec4 ambient_light; 138 | uniform float light_visibility; 139 | uniform float normal_map_enabled; 140 | uniform vec3 light_position; 141 | uniform vec3 light_orientation; 142 | uniform float specular_intensity; 143 | uniform float specular_power; 144 | 145 | varying vec3 Normal; 146 | varying vec4 lightPosition; 147 | varying vec4 ShadowCoord; 148 | varying vec3 light_position_frag; 149 | varying vec3 light_orientation_frag; 150 | varying vec3 light_0_frag; 151 | varying vec3 light_1_frag; 152 | varying float normal_map_enabled_frag; 153 | varying vec3 world_vertex_pos; 154 | 155 | uniform vec3 L; 156 | uniform vec3 N; 157 | vec2 poissonDisk[4]; 158 | 159 | 160 | /* 161 | normal mapping based on: 162 | http://ogldev.atspace.co.uk/www/tutorial26/tutorial26.html 163 | */ 164 | vec3 calc_bumped_normal(vec3 normal, vec2 text_coords) 165 | { 166 | vec3 c_normal = normalize(normal); 167 | vec3 tangent = normalize(t_tangent); 168 | tangent = normalize(tangent - dot(tangent, c_normal) * c_normal); 169 | vec3 bitangent = cross(tangent, c_normal); 170 | vec3 bump_map_normal = texture2D(texture2, text_coords).xyz; 171 | bump_map_normal = 2.0 * bump_map_normal - vec3(1.0, 1.0, 1.0); 172 | vec3 result; 173 | mat3 TBN = mat3(tangent, bitangent, c_normal); 174 | result = TBN * bump_map_normal; 175 | result = normalize(result); 176 | return result; 177 | } 178 | 179 | void main (void){ 180 | poissonDisk[0] = vec2( -0.94201624, -0.39906216 ); 181 | poissonDisk[1] = vec2( 0.94558609, -0.76890725 ); 182 | poissonDisk[2] = vec2( -0.094184101, -0.92938870 ); 183 | poissonDisk[3] = vec2( 0.34495938, 0.29387760 ); 184 | vec4 color1 = vec4(1.0,1.0,1.0,1.0); 185 | vec2 t_coords = tex_coord0; 186 | if (int(flip_coords) == 1) 187 | t_coords = vec2(tex_coord0.x, 1.0 - tex_coord0.y); 188 | 189 | color1 = texture2D( texture0, t_coords ); 190 | vec4 color2; 191 | 192 | vec4 v_normal = normalize( normal_mat_frag * normal_vec ) ; 193 | if (normal_map_enabled == 1.0) 194 | v_normal = vec4(calc_bumped_normal(v_normal.xyz, vec2(t_coords.x, 1.0 - t_coords.y)).xyz, .0); 195 | 196 | float diffuse = max(dot(v_normal.xyz, normalize(light_position_frag)), 0.0); 197 | 198 | float reg = -0.3; 199 | /*if (intensity > 0.75) color2 = vec4(1.0-reg, 1.0-reg, 1.0-reg, 1.0); 200 | else if (intensity > 0.65) color2 = vec4(0.95-reg, 0.95-reg, 0.95-reg, 1.0); 201 | else if (intensity > 0.50) color2 = vec4(0.9-reg, 0.9-reg, 0.9-reg, 1.0); 202 | else if (intensity > 0.45) color2 = vec4(0.85-reg, 0.85-reg, 0.85-reg, 1.0); 203 | else color2 = vec4(0.8-reg, 0.8-reg, 0.8, 1.0);*/ 204 | 205 | if (diffuse < min_light_intensity) diffuse = min_light_intensity; 206 | 207 | float visibility = 1.1; 208 | for (int i=0;i<4;i++){ 209 | if ( texture2D( texture1, ShadowCoord.xy + poissonDisk[i]/700.0).z < ShadowCoord.z-0.01 ){ 210 | visibility-=0.1; 211 | } 212 | } 213 | 214 | if (enabled_shadow == 0.0) visibility = 1.0; 215 | float res_alpha = 1.0; 216 | res_alpha = color1.a; 217 | 218 | if (lighting == 0.0) { 219 | visibility = light_intensity.x; 220 | diffuse = 1.0; 221 | } 222 | gl_FragColor = vec4(0, 0, 0, 1.0); 223 | vec4 f_color; 224 | visibility += light_visibility; 225 | 226 | vec4 DiffuseColor = vec4(0, 0, 0, 0); 227 | vec4 SpecularColor = vec4(0, 0, 0, 0); 228 | 229 | //vec3 eye_position_fragx = vec3(-4, 10, -109.7); 230 | vec3 VertexToEye = normalize(eye_position_frag - world_vertex_pos); 231 | vec3 LightReflect = normalize(reflect(vec3(normalize(light_position_frag.xyz-world_vertex_pos)), v_normal.xyz)); 232 | 233 | /*vec4 v_light = normalize( vec4(light_position_frag, 1.0) - vec4(world_vertex_pos.xyz, 1.0)); 234 | vec3 LightReflect = vec3(1.0, 1.0, 1.0) * pow(max(dot(v_light, vec4(v_normal.xyz,1)), 0.0), 0.9); 235 | SpecularColor = vec4(LightReflect, 1.0);*/ 236 | 237 | vec3 LightReflect2 = normalize(reflect(vec3(normalize(light_orientation_frag.xyz-world_vertex_pos)), v_normal.xyz)); 238 | vec3 LightReflect3 = normalize(reflect(vec3(normalize(light_0_frag.xyz-world_vertex_pos)), v_normal.xyz)); 239 | vec3 LightReflect4 = normalize(reflect(vec3(normalize(light_1_frag.xyz-world_vertex_pos)), v_normal.xyz)); 240 | 241 | float SpecularFactor = dot(VertexToEye, LightReflect); 242 | float SpecularFactor2 = dot(VertexToEye, LightReflect2); 243 | float SpecularFactor3 = dot(VertexToEye, LightReflect3); 244 | float SpecularFactor4 = dot(VertexToEye, LightReflect4); 245 | SpecularFactor = 0.01; 246 | //if (SpecularFactor > 0.0) { 247 | 248 | SpecularFactor = SpecularFactor > 0.0 ? pow(SpecularFactor, specular_power) : 0.0; 249 | SpecularFactor2 = SpecularFactor2 > 0.0 ? pow(SpecularFactor2, specular_power) : 0.0; 250 | SpecularFactor3 = SpecularFactor3 > 0.0 ? pow(SpecularFactor3, specular_power) : 0.0; 251 | SpecularFactor4 = SpecularFactor4 > 0.0 ? pow(SpecularFactor4, specular_power) : 0.0; 252 | 253 | if (SpecularFactor < 0.0) SpecularFactor = 0.0; 254 | if (SpecularFactor2 < 0.0) SpecularFactor2 = 0.0; 255 | if (SpecularFactor3 < 0.0) SpecularFactor3 = 0.0; 256 | if (SpecularFactor4 < 0.0) SpecularFactor4 = 0.0; 257 | 258 | if (SpecularFactor2 < 0.0) SpecularFactor2 = 0.0; 259 | if (SpecularFactor3 < 0.0) SpecularFactor3 = 0.0; 260 | if (SpecularFactor4 < 0.0) SpecularFactor4 = 0.0; 261 | 262 | float spec_result = SpecularFactor+SpecularFactor2+SpecularFactor3+SpecularFactor4; 263 | SpecularColor = vec4(specular_intensity * spec_result, 264 | specular_intensity * spec_result, 265 | specular_intensity * spec_result, 1.0); 266 | //} 267 | 268 | 269 | f_color = vec4((color1).xyz*visibility*diffuse, res_alpha) + SpecularColor; 270 | f_color.a = alpha; 271 | f_color += ambient_light; 272 | gl_FragColor = f_color; 273 | 274 | 275 | } 276 | 277 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/motionblur.glsl: -------------------------------------------------------------------------------- 1 | ---VERTEX SHADER------------------------------------------------------- 2 | #ifdef GL_ES 3 | precision highp float; 4 | #endif 5 | 6 | attribute vec3 v_pos; 7 | attribute vec4 blendIndices; 8 | attribute vec4 blendWeights; 9 | 10 | uniform mat4 modelview_mat; 11 | uniform mat4 projection_mat; 12 | uniform mat4 depthMVP; 13 | 14 | //uniform mat4 oldTransformation; 15 | uniform mat4 oldTransformation0; 16 | uniform mat4 oldTransformation1; 17 | uniform mat4 oldTransformation2; 18 | uniform mat4 oldTransformation3; 19 | uniform mat4 oldTransformation4; 20 | uniform mat4 oldTransformation5; 21 | uniform mat4 oldTransformation6; 22 | uniform mat4 oldTransformation7; 23 | uniform mat4 oldTransformation8; 24 | uniform mat4 oldTransformation9; 25 | uniform mat4 oldTransformation10; 26 | uniform mat4 oldTransformation11; 27 | uniform mat4 oldTransformation12; 28 | uniform mat4 oldTransformation13; 29 | uniform mat4 oldTransformation14; 30 | uniform mat4 oldTransformation15; 31 | uniform mat4 oldTransformation16; 32 | uniform mat4 oldTransformation17; 33 | uniform mat4 oldTransformation18; 34 | uniform mat4 oldTransformation19; 35 | uniform mat4 oldTransformation20; 36 | 37 | 38 | 39 | varying vec3 speed; 40 | uniform float id; 41 | 42 | vec3 getSpeed() 43 | { 44 | //mat4 oldTransformation = mat4(1, 0 ,0 , 900, 0, 1 ,0 ,0 ,0,0,1,1200,0,0,0,1.0); 45 | 46 | //vec4 oldScreenCoord = oldTransformation * vec4(v_pos, 1); 47 | mat4 oldTransformation = mat4(1); 48 | 49 | if (int(id) == 0) oldTransformation = oldTransformation0; 50 | else if (int(id) == 1) oldTransformation = oldTransformation1; 51 | else if (int(id) == 2) oldTransformation = oldTransformation2; 52 | else if (int(id) == 3) oldTransformation = oldTransformation3; 53 | else if (int(id) == 4) oldTransformation = oldTransformation4; 54 | else if (int(id) == 5) oldTransformation = oldTransformation5; 55 | else if (int(id) == 6) oldTransformation = oldTransformation6; 56 | else if (int(id) == 7) oldTransformation = oldTransformation7; 57 | else if (int(id) == 8) oldTransformation = oldTransformation8; 58 | else if (int(id) == 9) oldTransformation = oldTransformation9; 59 | else if (int(id) == 10) oldTransformation = oldTransformation10; 60 | else if (int(id) == 11) oldTransformation = oldTransformation11; 61 | else if (int(id) == 12) oldTransformation = oldTransformation12; 62 | else if (int(id) == 13) oldTransformation = oldTransformation13; 63 | else if (int(id) == 14) oldTransformation = oldTransformation14; 64 | else if (int(id) == 15) oldTransformation = oldTransformation15; 65 | else if (int(id) == 16) oldTransformation = oldTransformation16; 66 | else if (int(id) == 17) oldTransformation = oldTransformation17; 67 | else if (int(id) == 18) oldTransformation = oldTransformation18; 68 | else if (int(id) == 18) oldTransformation = oldTransformation19; 69 | else if (int(id) == 20) oldTransformation = oldTransformation20; 70 | 71 | 72 | vec4 oldScreenCoord = oldTransformation * vec4(v_pos, 1); 73 | vec4 newScreenCoord = projection_mat * vec4(v_pos, 1); 74 | vec2 v = newScreenCoord.xy / newScreenCoord.w - oldScreenCoord.xy / oldScreenCoord.w; 75 | float norm = length(v); 76 | return vec3(normalize(v), norm); 77 | //return vec2(0.0, 0.0); 78 | //return vec3(normalize(v), norm); 79 | } 80 | 81 | 82 | 83 | void main (void) { 84 | //compute vertex position in eye_sapce and normalize normal vector 85 | //projection_mat = mat4(0.750, 0,0,0,0,1,0,0,0,0,-1.003,-1,0,0,-2.00,0.0); 86 | vec4 pos = modelview_mat * vec4(v_pos,1.0); 87 | 88 | pos = projection_mat * pos; 89 | 90 | speed = getSpeed(); 91 | gl_Position = pos; 92 | 93 | 94 | } 95 | 96 | 97 | ---FRAGMENT SHADER----------------------------------------------------- 98 | #ifdef GL_ES 99 | precision highp float; 100 | #endif 101 | 102 | 103 | uniform float cast_shadows; 104 | uniform float id; 105 | // Ouput data 106 | //layout(location = 0) out float fragmentdepth; 107 | 108 | varying vec3 speed; 109 | vec3 getSpeedColor() 110 | { 111 | //return vec3(0.5 + 0.5 * speed, 0.); 112 | return vec3(0.5 + 0.5 * speed.xy, pow(speed.z, 0.5)); 113 | } 114 | 115 | 116 | 117 | void main(){ 118 | // Not really needed, OpenGL does it anyway 119 | //fragmentdepth = gl_FragCoord.z; 120 | //if (int(id) > 2) 121 | // return vec4(); 122 | /*gl_FragColor.x = gl_FragCoord.z; 123 | gl_FragColor.y = gl_FragCoord.z; 124 | gl_FragColor.z = gl_FragCoord.z; 125 | gl_FragColor.a = 1.0;*/ 126 | gl_FragColor.xyz = getSpeedColor(); 127 | gl_FragColor.a = 1.0; 128 | //if (cast_shadows==0) gl_FragColor.a = 1.0; 129 | //gl_FragColor = vec4(gl_FragCoord.z); 130 | } 131 | 132 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/selection.glsl: -------------------------------------------------------------------------------- 1 | ---VERTEX SHADER------------------------------------------------------- 2 | #ifdef GL_ES 3 | precision highp float; 4 | #endif 5 | 6 | attribute vec3 v_pos; 7 | attribute vec3 v_normal; 8 | attribute vec2 v_tc0; 9 | 10 | uniform mat4 modelview_mat; 11 | uniform mat4 projection_mat; 12 | uniform mat4 camera; 13 | 14 | uniform float pitch; 15 | uniform float yaw; 16 | uniform float roll; 17 | 18 | uniform vec3 mesh_pos; 19 | 20 | varying vec4 normal_vec; 21 | varying vec4 vertex_pos; 22 | varying vec2 tex_coord0; 23 | 24 | vec4 quat_from_axis_angle(vec3 axis, float angle) 25 | { 26 | vec4 qr; 27 | float half_angle = (angle * 0.5) * 3.14159 / 180.0; 28 | qr.x = axis.x * sin(half_angle); 29 | qr.y = axis.y * sin(half_angle); 30 | qr.z = axis.z * sin(half_angle); 31 | qr.w = cos(half_angle); 32 | return qr; 33 | } 34 | 35 | vec4 quat_conj(vec4 q) 36 | { 37 | return vec4(-q.x, -q.y, -q.z, q.w); 38 | } 39 | 40 | vec4 quat_mult(vec4 q1, vec4 q2) 41 | { 42 | vec4 qr; 43 | qr.x = (q1.w * q2.x) + (q1.x * q2.w) + (q1.y * q2.z) - (q1.z * q2.y); 44 | qr.y = (q1.w * q2.y) - (q1.x * q2.z) + (q1.y * q2.w) + (q1.z * q2.x); 45 | qr.z = (q1.w * q2.z) + (q1.x * q2.y) - (q1.y * q2.x) + (q1.z * q2.w); 46 | qr.w = (q1.w * q2.w) - (q1.x * q2.x) - (q1.y * q2.y) - (q1.z * q2.z); 47 | return qr; 48 | } 49 | 50 | vec4 quat_sum(vec4 q1, vec4 q2) 51 | { 52 | vec4 qr; 53 | qr.x = q1.x - q2.x; 54 | qr.y = q1.y - q2.y; 55 | qr.z = q1.z - q2.z; 56 | qr.w = q1.w - q2.w; 57 | return qr; 58 | } 59 | 60 | /*vec3 rotate_vertex_position(vec3 position, vec3 axis, float angle) 61 | { 62 | vec4 qr = quat_from_axis_angle(axis, angle); 63 | vec4 qr_conj = quat_conj(qr); 64 | vec4 q_pos = vec4(position.x, position.y, position.z, 0); 65 | 66 | vec4 q_tmp = quat_mult(qr, q_pos); 67 | qr = quat_mult(q_tmp, qr_conj); 68 | 69 | return vec3(qr.x, qr.y, qr.z); 70 | }*/ 71 | 72 | vec3 rotate_vertex_position(vec3 position, vec3 axis, float angle) 73 | { 74 | vec4 q = quat_from_axis_angle(axis, angle); 75 | vec3 v = position.xyz; 76 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); 77 | } 78 | 79 | vec3 rotate_vertex_position_q(vec3 position, vec4 q) 80 | { 81 | vec3 v = position.xyz; 82 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); 83 | } 84 | 85 | 86 | void main (void) { 87 | //compute vertex position in eye_sapce and normalize normal vector 88 | vec4 pitch_quat = quat_from_axis_angle(vec3(1., 0., 0.), pitch); 89 | vec4 yaw_quat = quat_from_axis_angle(vec3(0., 1., 0.), yaw); 90 | vec4 roll_quat = quat_from_axis_angle(vec3(0., 0., 1.), roll); 91 | 92 | vec4 res_quat = quat_mult(quat_mult(pitch_quat, yaw_quat), roll_quat); 93 | 94 | //vec4 res_quat = quat_sum(quat_sum(pitch_quat, yaw_quat), roll_quat); 95 | 96 | //vec3 P = rotate_vertex_position_q(v_pos, res_quat); 97 | vec4 pos = modelview_mat * vec4(v_pos, 1.0); 98 | 99 | pos = vec4(rotate_vertex_position_q(pos.xyz - mesh_pos, res_quat) + mesh_pos, 1.0) ; 100 | 101 | vertex_pos = pos; 102 | normal_vec = vec4(v_normal,0.0); 103 | tex_coord0 = v_tc0; 104 | 105 | gl_Position = projection_mat * camera * pos; 106 | } 107 | 108 | 109 | ---FRAGMENT SHADER----------------------------------------------------- 110 | #ifdef GL_ES 111 | precision highp float; 112 | #endif 113 | 114 | varying vec4 normal_vec; 115 | varying vec4 vertex_pos; 116 | 117 | uniform mat4 normal_mat; 118 | uniform vec3 id_color; 119 | 120 | varying vec2 tex_coord0; 121 | 122 | void main (void){ 123 | //gl_FragColor = vec4(0, 0.4, 0.8, 1.0); 124 | float id = id_color.x; 125 | gl_FragColor.x = id; 126 | gl_FragColor.y = tex_coord0.x; 127 | gl_FragColor.z = tex_coord0.y; 128 | 129 | //gl_FragColor.y = gl_FragCoord.x / gl_FragCoord.w; 130 | //gl_FragColor.z = gl_FragCoord.y / gl_FragCoord.w; 131 | 132 | gl_FragColor.a = 1.0; 133 | if (tex_coord0.x <= 0.01 || tex_coord0.x >= 0.99) 134 | gl_FragColor.x = 0.99; 135 | 136 | if (tex_coord0.y <= 0.01 || tex_coord0.y >= 0.99) 137 | gl_FragColor.x = 0.99; 138 | } 139 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/shadowpass.glsl: -------------------------------------------------------------------------------- 1 | ---VERTEX SHADER------------------------------------------------------- 2 | #ifdef GL_ES 3 | precision highp float; 4 | #endif 5 | 6 | attribute vec3 v_pos; 7 | attribute vec4 blendIndices; 8 | attribute vec4 blendWeights; 9 | 10 | uniform vec3 mesh_pos; 11 | 12 | uniform float pitch; 13 | uniform float yaw; 14 | uniform float roll; 15 | 16 | uniform mat4 modelview_mat; 17 | uniform mat4 projection_mat; 18 | uniform mat4 depthMVP; 19 | 20 | vec4 quat_from_axis_angle(vec3 axis, float angle) 21 | { 22 | vec4 qr; 23 | float half_angle = (angle * 0.5) * 3.14159 / 180.0; 24 | qr.x = axis.x * sin(half_angle); 25 | qr.y = axis.y * sin(half_angle); 26 | qr.z = axis.z * sin(half_angle); 27 | qr.w = cos(half_angle); 28 | return qr; 29 | } 30 | 31 | vec4 quat_conj(vec4 q) 32 | { 33 | return vec4(-q.x, -q.y, -q.z, q.w); 34 | } 35 | 36 | vec4 quat_mult(vec4 q1, vec4 q2) 37 | { 38 | vec4 qr; 39 | qr.x = (q1.w * q2.x) + (q1.x * q2.w) + (q1.y * q2.z) - (q1.z * q2.y); 40 | qr.y = (q1.w * q2.y) - (q1.x * q2.z) + (q1.y * q2.w) + (q1.z * q2.x); 41 | qr.z = (q1.w * q2.z) + (q1.x * q2.y) - (q1.y * q2.x) + (q1.z * q2.w); 42 | qr.w = (q1.w * q2.w) - (q1.x * q2.x) - (q1.y * q2.y) - (q1.z * q2.z); 43 | return qr; 44 | } 45 | 46 | vec4 quat_sum(vec4 q1, vec4 q2) 47 | { 48 | vec4 qr; 49 | qr.x = q1.x - q2.x; 50 | qr.y = q1.y - q2.y; 51 | qr.z = q1.z - q2.z; 52 | qr.w = q1.w - q2.w; 53 | return qr; 54 | } 55 | 56 | /*vec3 rotate_vertex_position(vec3 position, vec3 axis, float angle) 57 | { 58 | vec4 qr = quat_from_axis_angle(axis, angle); 59 | vec4 qr_conj = quat_conj(qr); 60 | vec4 q_pos = vec4(position.x, position.y, position.z, 0); 61 | 62 | vec4 q_tmp = quat_mult(qr, q_pos); 63 | qr = quat_mult(q_tmp, qr_conj); 64 | 65 | return vec3(qr.x, qr.y, qr.z); 66 | }*/ 67 | 68 | vec3 rotate_vertex_position(vec3 position, vec3 axis, float angle) 69 | { 70 | vec4 q = quat_from_axis_angle(axis, angle); 71 | vec3 v = position.xyz; 72 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); 73 | } 74 | 75 | vec3 rotate_vertex_position_q(vec3 position, vec4 q) 76 | { 77 | vec3 v = position.xyz; 78 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); 79 | } 80 | 81 | 82 | 83 | void main (void) { 84 | //compute vertex position in eye_sapce and normalize normal vector 85 | //projection_mat = mat4(0.750, 0,0,0,0,1,0,0,0,0,-1.003,-1,0,0,-2.00,0.0); 86 | vec4 pitch_quat = quat_from_axis_angle(vec3(1., 0., 0.), pitch); 87 | vec4 yaw_quat = quat_from_axis_angle(vec3(0., 1., 0.), yaw); 88 | vec4 roll_quat = quat_from_axis_angle(vec3(0., 0., 1.), roll); 89 | 90 | vec4 res_quat = quat_mult(quat_mult(pitch_quat, yaw_quat), roll_quat); 91 | //vec3 P = rotate_vertex_position_q(v_pos, res_quat); 92 | 93 | 94 | vec4 pos = modelview_mat * vec4(v_pos, 1.0); 95 | 96 | pos = vec4(rotate_vertex_position_q(pos.xyz - mesh_pos, res_quat) + mesh_pos, 1.0) ; 97 | 98 | //pos = projection_mat * pos; 99 | 100 | 101 | gl_Position = depthMVP * pos; 102 | 103 | } 104 | 105 | 106 | ---FRAGMENT SHADER----------------------------------------------------- 107 | #ifdef GL_ES 108 | precision highp float; 109 | #endif 110 | 111 | 112 | uniform float cast_shadows; 113 | // Ouput data 114 | //layout(location = 0) out float fragmentdepth; 115 | 116 | void main(){ 117 | // Not really needed, OpenGL does it anyway 118 | //fragmentdepth = gl_FragCoord.z; 119 | 120 | gl_FragColor.x = gl_FragCoord.z; 121 | gl_FragColor.y = gl_FragCoord.z; 122 | gl_FragColor.z = gl_FragCoord.z; 123 | gl_FragColor.a = 1.0; 124 | if (cast_shadows==0.0) gl_FragColor.a = 0.0; 125 | //gl_FragColor = vec4(gl_FragCoord.z); 126 | } 127 | 128 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/shaders/simple_no_light.glsl: -------------------------------------------------------------------------------- 1 | ---VERTEX SHADER------------------------------------------------------- 2 | #ifdef GL_ES 3 | precision highp float; 4 | #endif 5 | 6 | attribute vec3 v_pos; 7 | attribute vec3 v_normal; 8 | attribute vec2 v_tc0; 9 | attribute vec2 vert_pos; 10 | 11 | uniform mat4 modelview_mat; 12 | uniform mat4 projection_mat; 13 | uniform vec2 val_sin; 14 | 15 | 16 | varying vec4 normal_vec; 17 | varying vec4 vertex_pos; 18 | varying vec2 tex_coord0; 19 | 20 | 21 | uniform sampler2D texture0; 22 | 23 | void main (void) { 24 | //compute vertex position in eye_sapce and normalize normal vector 25 | //projection_mat = mat4(0.750, 0,0,0,0,1,0,0,0,0,-1.003,-1,0,0,-2.00,0.0); 26 | vec4 pos = modelview_mat * vec4(v_pos,1.0); 27 | vertex_pos = pos; 28 | normal_vec = vec4(v_normal,0.0); 29 | tex_coord0 = v_tc0; 30 | gl_Position = projection_mat * pos; 31 | //gl_Position = projection_mat * vec4(pos[0]*mul1, pos[1]*mul2, pos[2], pos[3]); 32 | //gl_Position = projection_mat * vec4(pos[0]*sin(vert_pos.x/val_sin.x), pos[1]*sin(vert_pos.x/val_sin.x), pos[2], pos[3]); 33 | } 34 | 35 | 36 | ---FRAGMENT SHADER----------------------------------------------------- 37 | #ifdef GL_ES 38 | precision highp float; 39 | #endif 40 | 41 | uniform vec2 cond; 42 | 43 | 44 | varying vec4 normal_vec; 45 | varying vec4 vertex_pos; 46 | varying vec2 tex_coord0; 47 | uniform sampler2D texture0; 48 | 49 | uniform mat4 normal_mat; 50 | 51 | void main (void){ 52 | //correct normal, and compute light vector (assume light at the eye) 53 | vec2 uv = tex_coord0; 54 | vec4 col = texture2D(texture0,uv); 55 | 56 | gl_FragColor = col; 57 | 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/toonshader/toon.glsl: -------------------------------------------------------------------------------- 1 | /* simple.glsl 2 | 3 | simple diffuse lighting based on laberts cosine law; see e.g.: 4 | http://en.wikipedia.org/wiki/Lambertian_reflectance 5 | http://en.wikipedia.org/wiki/Lambert%27s_cosine_law 6 | */ 7 | ---VERTEX SHADER------------------------------------------------------- 8 | #ifdef GL_ES 9 | precision highp float; 10 | #endif 11 | 12 | attribute vec3 v_pos; 13 | attribute vec3 v_normal; 14 | attribute vec2 v_tc0; 15 | attribute vec4 blendIndices; 16 | attribute vec4 blendWeights; 17 | 18 | uniform mat4 modelview_mat; 19 | uniform mat4 projection_mat; 20 | uniform mat4 matrix_view; 21 | uniform vec2 val_sin; 22 | uniform mat4 depthMVP; 23 | uniform float enabled_shadow; 24 | uniform mat4 normal_mat; 25 | 26 | varying vec4 normal_vec; 27 | varying vec3 vertex_pos; 28 | varying vec2 tex_coord0; 29 | varying vec4 ShadowCoord; 30 | varying vec3 Normal; 31 | varying vec4 lightPosition; 32 | varying float edge; 33 | varying vec3 L; 34 | varying vec3 N; 35 | uniform sampler2D texture0; 36 | uniform sampler2DShadow texture1; 37 | 38 | mat4 depthBiasMVP = mat4(0.5, 0.0, 0.0, 0.0, 39 | 0.0, 0.5, 0.0, 0.0, 40 | 0.0, 0.0, 0.5, 0.0, 41 | 0.5, 0.5, 0.5, 1.0); 42 | 43 | mat4 M = mat4(1.0, 0.0, 0.0, 0.0, 44 | 0.0, 1.0, 0.0, 0.0, 45 | 0.0, 0.0, 1.0, 0.0, 46 | 0.0, 0.0, 0.0, 1.0); 47 | 48 | 49 | void main (void) { 50 | normal_vec = vec4(v_normal,0.0); 51 | vec4 pos = modelview_mat * vec4(v_pos,1.0); 52 | vec3 N = normalize(normal_mat * normal_vec).xyz; 53 | vec3 E = normalize(vec3(0,0,0)-pos.xyz); 54 | //Normal = normalize(gl_NormalMatrix * v_normal).xyz; 55 | #ifdef __GLSL_CG_DATA_TYPES // Fix clipping for Nvidia and ATI 56 | gl_ClipVertex = projection_mat * gl_Vertex; 57 | #endif 58 | //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 59 | float dne = dot(N, E); 60 | edge = dne > 0.0 ? dne : 0.0; 61 | lightPosition = modelview_mat * vec4(0.5, 200, 0, 1); 62 | vec4 e_pos = projection_mat * pos; 63 | tex_coord0 = v_tc0; 64 | ShadowCoord = depthBiasMVP*depthMVP * pos; 65 | //ShadowCoord = depthMVP * pos; 66 | 67 | 68 | // Position of the vertex, in worldspace : M * position 69 | //Position_worldspace = (M*v_pos).xyz; 70 | 71 | // Vector that goes from the vertex to the camera, in camera space. 72 | // In camera space, the camera is at the origin (0,0,0). 73 | vec3 vertexPosition_cameraspace = (pos).xyz; 74 | vec3 EyeDirection_cameraspace = vec3(0,0,0) - vertexPosition_cameraspace; 75 | 76 | // Vector that goes from the vertex to the light, in camera space. M is ommited because it's identity. 77 | vec3 LightPosition_cameraspace = vec4(vec3(0.5, 200, 100),0).xyz; 78 | L = LightPosition_cameraspace + EyeDirection_cameraspace; 79 | //L = LightPosition_cameraspace + EyeDirection_cameraspace; 80 | 81 | // Normal of the the vertex, in camera space 82 | N = ( modelview_mat * vec4(v_normal,0)).xyz; // Only correct if ModelMatrix does not scale the model ! Use its inverse transpose if not. 83 | gl_Position = e_pos; 84 | vertex_pos = e_pos.xyz; 85 | } 86 | 87 | 88 | ---FRAGMENT SHADER----------------------------------------------------- 89 | #ifdef GL_ES 90 | precision highp float; 91 | #endif 92 | 93 | uniform vec2 cond; 94 | 95 | 96 | varying vec4 normal_vec; 97 | varying vec3 vertex_pos; 98 | varying vec2 tex_coord0; 99 | varying float edge; 100 | uniform float enabled_shadow; 101 | uniform float lighting; 102 | uniform float flip_coords; 103 | uniform vec4 light_intensity; 104 | uniform sampler2D texture0; 105 | uniform sampler2DShadow texture1; 106 | 107 | uniform mat4 normal_mat; 108 | varying vec3 Normal; 109 | varying vec4 lightPosition; 110 | varying vec4 ShadowCoord; 111 | uniform vec3 L; 112 | uniform vec3 N; 113 | vec3 LightPosition = vec3(0.5, 50, 100); 114 | vec2 poissonDisk[4]; 115 | 116 | void main (void){ 117 | poissonDisk[0] = vec2( -0.94201624, -0.39906216 ); 118 | poissonDisk[1] = vec2( 0.94558609, -0.76890725 ); 119 | poissonDisk[2] = vec2( -0.094184101, -0.92938870 ); 120 | poissonDisk[3] = vec2( 0.34495938, 0.29387760 ); 121 | vec4 color1 = vec4(1.0,1.0,1.0,1.0); 122 | vec2 t_coords = tex_coord0; 123 | if (int(flip_coords) == 1) 124 | t_coords = vec2(tex_coord0.x, 1.0 - tex_coord0.y); 125 | 126 | 127 | color1 = texture2D( texture0, t_coords ); 128 | vec4 color2; 129 | 130 | //vec4 v_normal = normalize( normal_mat * normal_vec ) ; 131 | vec4 v_normal = normalize( normal_mat * normal_vec ) ; 132 | vec4 v_light = normalize( vec4(0,0,0,1) - vec4(vertex_pos, 1) ); 133 | 134 | float intensity = dot(normalize(LightPosition),v_normal.xyz); 135 | 136 | if (intensity > 0.80) color2 = vec4(1.0, 1.0, 1.0, 1.0); 137 | else if (intensity > 0.75) color2 = vec4(0.8, 0.8, 0.8, 1.0); 138 | else if (intensity > 0.50) color2 = vec4(0.6, 0.6, 0.6, 1.0); 139 | else if (intensity > 0.25) color2 = vec4(0.4, 0.4, 0.4, 1.0); 140 | else color2 = vec4(0.2, 0.2, 0.2, 1.0); 141 | 142 | if (lighting == 0.0) color2 = light_intensity; 143 | 144 | float visibility = 1.1; 145 | vec3 n = normalize(N); 146 | vec3 l = normalize(L); 147 | float dnl = dot( n,l); 148 | 149 | float mct = dnl > 0.0 ? dnl : 0.0; 150 | float cosTheta = mct < 1.0 ? mct : 1.0; 151 | //float cosTheta = clamp( dot( n,l), 0,1 ); 152 | float bias = 0.005*tan(acos(cosTheta)); // cosTheta is dot( n,l ), clamped between 0 and 1 153 | 154 | float mbias = bias > 0.0 ? bias : 0.0; 155 | bias = bias < 0.01 ? bias : 0.01; 156 | //bias = clamp(bias, 0,0.01); 157 | 158 | vec4 color = shadow2D( texture1, ShadowCoord.xyz ); 159 | 160 | 161 | //if ( color.z < ShadowCoord.z-bias){ 162 | // visibility = 0.3; 163 | //} 164 | for (int i=0;i<4;i++){ 165 | if ( shadow2D( texture1, vec3(ShadowCoord.xy + poissonDisk[i]/700.0, ShadowCoord.z) ).z < ShadowCoord.z-bias ){ 166 | visibility-=0.15; 167 | } 168 | } 169 | 170 | if (enabled_shadow == 0.0) visibility = 1.0; 171 | float res_alpha = 1.0; 172 | res_alpha = color1.a; 173 | 174 | visibility += 0.4; 175 | if (edge >= 0.00){ 176 | vec4 f_color; 177 | f_color = vec4((color1 * color2).xyz*visibility, res_alpha); 178 | gl_FragColor = f_color; 179 | } 180 | else 181 | //gl_FragColor = vec4((color1 * color2).xyz*0.8, 1); 182 | gl_FragColor = vec4(0, 0, 0, 1.0); 183 | 184 | //if (visibility == 0.5) 185 | // gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); 186 | 187 | //gl_FragColor = color; 188 | //gl_FragColor = color1; 189 | 190 | 191 | } 192 | 193 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/toonshader/toon_shadows.glsl: -------------------------------------------------------------------------------- 1 | /* simple.glsl 2 | 3 | simple diffuse lighting based on laberts cosine law; see e.g.: 4 | http://en.wikipedia.org/wiki/Lambertian_reflectance 5 | http://en.wikipedia.org/wiki/Lambert%27s_cosine_law 6 | */ 7 | ---VERTEX SHADER------------------------------------------------------- 8 | #ifdef GL_ES 9 | precision highp float; 10 | #endif 11 | 12 | attribute vec3 v_pos; 13 | attribute vec3 v_normal; 14 | attribute vec2 v_tc0; 15 | attribute vec3 tangent; 16 | attribute vec4 blendIndices; 17 | attribute vec4 blendWeights; 18 | 19 | 20 | uniform mat4 projection_mat; 21 | uniform mat4 camera; 22 | uniform mat4 matrix_view; 23 | uniform vec2 val_sin; 24 | uniform mat4 depthMVP; 25 | uniform float enabled_shadow; 26 | uniform float min_light_intensity; 27 | uniform mat4 normal_mat; 28 | uniform vec4 ambient_light; 29 | uniform vec4 light_intensity; 30 | uniform float light_visibility; 31 | uniform vec3 eye_position; 32 | uniform mat4 modelview_mat; 33 | uniform vec3 light_position; 34 | uniform vec3 light_orientation; 35 | uniform vec3 light_0; 36 | uniform vec3 light_1; 37 | 38 | uniform vec3 mesh_pos; 39 | 40 | uniform float specular_intensity; 41 | uniform float specular_power; 42 | uniform float pitch; 43 | uniform float yaw; 44 | uniform float roll; 45 | uniform int axis_type; 46 | 47 | varying mat4 modelview_mat_frag; 48 | varying vec3 eye_position_frag; 49 | varying vec3 world_vertex_pos; 50 | varying mat4 normal_mat_frag; 51 | varying vec4 normal_vec; 52 | varying vec3 vertex_pos; 53 | varying vec4 mv_vertex_pos; 54 | 55 | varying vec2 tex_coord0; 56 | varying vec3 t_tangent; 57 | varying vec4 ShadowCoord; 58 | varying vec3 Normal; 59 | varying vec4 lightPosition; 60 | varying float edge; 61 | varying vec3 L; 62 | varying vec3 N; 63 | varying vec3 light_position_frag; 64 | varying vec3 light_orientation_frag; 65 | varying vec3 light_0_frag; 66 | varying vec3 light_1_frag; 67 | varying float normal_map_enabled_frag; 68 | 69 | uniform sampler2D texture0; 70 | uniform sampler2D texture1; 71 | uniform sampler2D texture2; 72 | uniform float normal_map_enabled; 73 | 74 | mat4 depthBiasMVP = mat4(0.5, 0.0, 0.0, 0.0, 75 | 0.0, 0.5, 0.0, 0.0, 76 | 0.0, 0.0, 0.5, 0.0, 77 | 0.5, 0.5, 0.5, 1.0); 78 | 79 | mat4 M = mat4(1.0, 0.0, 0.0, 0.0, 80 | 0.0, 1.0, 0.0, 0.0, 81 | 0.0, 0.0, 1.0, 0.0, 82 | 0.0, 0.0, 0.0, 1.0); 83 | 84 | vec4 quat_from_axis_angle(vec3 axis, float angle) 85 | { 86 | vec4 qr; 87 | float half_angle = (angle * 0.5) * 3.14159 / 180.0; 88 | qr.x = axis.x * sin(half_angle); 89 | qr.y = axis.y * sin(half_angle); 90 | qr.z = axis.z * sin(half_angle); 91 | qr.w = cos(half_angle); 92 | return qr; 93 | } 94 | 95 | vec4 quat_conj(vec4 q) 96 | { 97 | return vec4(-q.x, -q.y, -q.z, q.w); 98 | } 99 | 100 | vec4 quat_mult(vec4 q1, vec4 q2) 101 | { 102 | vec4 qr; 103 | qr.x = (q1.w * q2.x) + (q1.x * q2.w) + (q1.y * q2.z) - (q1.z * q2.y); 104 | qr.y = (q1.w * q2.y) - (q1.x * q2.z) + (q1.y * q2.w) + (q1.z * q2.x); 105 | qr.z = (q1.w * q2.z) + (q1.x * q2.y) - (q1.y * q2.x) + (q1.z * q2.w); 106 | qr.w = (q1.w * q2.w) - (q1.x * q2.x) - (q1.y * q2.y) - (q1.z * q2.z); 107 | return qr; 108 | } 109 | 110 | vec4 quat_sum(vec4 q1, vec4 q2) 111 | { 112 | vec4 qr; 113 | qr.x = q1.x - q2.x; 114 | qr.y = q1.y - q2.y; 115 | qr.z = q1.z - q2.z; 116 | qr.w = q1.w - q2.w; 117 | return qr; 118 | } 119 | 120 | /*vec3 rotate_vertex_position(vec3 position, vec3 axis, float angle) 121 | { 122 | vec4 qr = quat_from_axis_angle(axis, angle); 123 | vec4 qr_conj = quat_conj(qr); 124 | vec4 q_pos = vec4(position.x, position.y, position.z, 0); 125 | 126 | vec4 q_tmp = quat_mult(qr, q_pos); 127 | qr = quat_mult(q_tmp, qr_conj); 128 | 129 | return vec3(qr.x, qr.y, qr.z); 130 | }*/ 131 | 132 | vec3 rotate_vertex_position(vec3 position, vec3 axis, float angle) 133 | { 134 | vec4 q = quat_from_axis_angle(axis, angle); 135 | vec3 v = position.xyz; 136 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); 137 | } 138 | 139 | vec3 rotate_vertex_position_q(vec3 position, vec4 q) 140 | { 141 | vec3 v = position.xyz; 142 | return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); 143 | } 144 | 145 | void main (void) { 146 | normal_vec = vec4(v_normal,1.0); 147 | vec4 pitch_quat = quat_from_axis_angle(vec3(1., 0., 0.), pitch); 148 | vec4 yaw_quat = quat_from_axis_angle(vec3(0., 1., 0.), yaw); 149 | vec4 roll_quat = quat_from_axis_angle(vec3(0., 0., 1.), roll); 150 | 151 | vec4 res_quat = vec4(0, 0, 0, 1); 152 | res_quat = quat_mult(quat_mult(pitch_quat, yaw_quat), roll_quat); 153 | 154 | //vec4 res_quat = quat_sum(quat_sum(pitch_quat, yaw_quat), roll_quat); 155 | 156 | vec3 P = rotate_vertex_position_q(v_pos, res_quat); 157 | vec4 pos = modelview_mat * vec4(v_pos, 1.0); 158 | 159 | pos = vec4(rotate_vertex_position_q(pos.xyz - mesh_pos, res_quat) + mesh_pos, 1.0) ; 160 | //vec4 pos = modelview_mat * vec4(P, 1.0); 161 | 162 | #ifdef __GLSL_CG_DATA_TYPES // Fix clipping for Nvidia and ATI 163 | gl_ClipVertex = projection_mat * gl_Vertex; 164 | #endif 165 | 166 | lightPosition = modelview_mat * camera* vec4(0.5, 200, 0, 1) ; 167 | 168 | 169 | vec4 e_pos = projection_mat * camera * pos; 170 | normal_vec = /*modelview_mat * projection_mat * */ vec4(rotate_vertex_position_q(normal_vec.xyz, res_quat), 1.0); 171 | 172 | tex_coord0 = v_tc0; 173 | ShadowCoord = depthBiasMVP*depthMVP * pos; 174 | //t_tangent = (projection_mat * camera * vec4(tangent, 1.0)).xyz; 175 | t_tangent = (normal_mat * vec4(tangent, 1.0)).xyz; 176 | 177 | normal_mat_frag = normal_mat; 178 | modelview_mat_frag = modelview_mat; 179 | eye_position_frag = (projection_mat * modelview_mat * camera * vec4(eye_position,1.0)).xyz; 180 | 181 | light_position_frag = light_position; 182 | light_orientation_frag = light_orientation; 183 | normal_map_enabled_frag = normal_map_enabled; 184 | //world_vertex_pos = (vec4(v_pos.xyz, 1.0)).xyz; 185 | //world_vertex_pos = (projection_mat * modelview_mat * camera * vec4(P, 1.0)).xyz; 186 | world_vertex_pos = e_pos.xyz; 187 | light_0_frag = light_0; 188 | light_1_frag = light_1; 189 | 190 | 191 | //gl_Position = e_pos; 192 | gl_Position = e_pos; 193 | vertex_pos = e_pos.xyz; 194 | mv_vertex_pos = modelview_mat * vec4(P, 1.0); 195 | } 196 | 197 | 198 | ---FRAGMENT SHADER----------------------------------------------------- 199 | #ifdef GL_ES 200 | precision highp float; 201 | #endif 202 | 203 | uniform vec2 cond; 204 | 205 | 206 | varying vec4 normal_vec; 207 | varying vec3 vertex_pos; 208 | varying vec4 mv_vertex_pos; 209 | 210 | varying vec2 tex_coord0; 211 | varying vec3 t_tangent; 212 | varying vec3 eye_position_frag; 213 | 214 | varying float edge; 215 | varying mat4 modelview_mat_frag; 216 | varying mat4 normal_mat_frag; 217 | 218 | uniform float alpha; 219 | uniform float alpha_threshold; 220 | uniform float shadows_bias; 221 | uniform float enabled_shadow; 222 | uniform float min_light_intensity; 223 | uniform float lighting; 224 | uniform float flip_coords; 225 | uniform vec4 light_intensity; 226 | uniform sampler2D texture0; 227 | uniform sampler2D texture1; 228 | uniform sampler2D texture2; 229 | uniform vec4 ambient_light; 230 | uniform float light_visibility; 231 | uniform float normal_map_enabled; 232 | uniform vec3 light_position; 233 | uniform vec3 light_orientation; 234 | uniform float specular_intensity; 235 | uniform float specular_power; 236 | 237 | varying vec3 Normal; 238 | varying vec4 lightPosition; 239 | varying vec4 ShadowCoord; 240 | varying vec3 light_position_frag; 241 | varying vec3 light_orientation_frag; 242 | varying vec3 light_0_frag; 243 | varying vec3 light_1_frag; 244 | varying float normal_map_enabled_frag; 245 | varying vec3 world_vertex_pos; 246 | 247 | uniform vec3 L; 248 | uniform vec3 N; 249 | vec2 poissonDisk[4]; 250 | 251 | 252 | /* 253 | normal mapping based on: 254 | http://ogldev.atspace.co.uk/www/tutorial26/tutorial26.html 255 | */ 256 | vec3 calc_bumped_normal(vec3 normal, vec2 text_coords) 257 | { 258 | vec3 c_normal = normalize(normal); 259 | vec3 tangent = normalize(t_tangent); 260 | tangent = normalize(tangent - dot(tangent, c_normal) * c_normal); 261 | vec3 bitangent = cross(tangent, c_normal); 262 | vec3 bump_map_normal = texture2D(texture2, text_coords).xyz; 263 | bump_map_normal = 2.0 * bump_map_normal - vec3(1.0, 1.0, 1.0); 264 | vec3 result; 265 | mat3 TBN = mat3(tangent, bitangent, c_normal); 266 | result = TBN * bump_map_normal; 267 | result = normalize(result); 268 | return result; 269 | } 270 | 271 | void main (void){ 272 | poissonDisk[0] = vec2( -0.94201624, -0.39906216 ); 273 | poissonDisk[1] = vec2( 0.94558609, -0.76890725 ); 274 | poissonDisk[2] = vec2( -0.094184101, -0.92938870 ); 275 | poissonDisk[3] = vec2( 0.34495938, 0.29387760 ); 276 | vec4 color1 = vec4(1.0,1.0,1.0,1.0); 277 | vec2 t_coords = tex_coord0; 278 | if (int(flip_coords) == 1) 279 | t_coords = vec2(tex_coord0.x, 1.0 - tex_coord0.y); 280 | 281 | color1 = texture2D( texture0, t_coords ); 282 | vec4 color2; 283 | 284 | vec4 v_normal = normalize( normal_mat_frag * normal_vec ) + vec4(0.3, 0.3, 0.3, 1.0); 285 | //vec3 light_position_f = normalize(vec4(10, 100, 100, 1) - mv_vertex_pos).xyz; 286 | vec3 light_position_f = light_position_frag - mv_vertex_pos.xyz; 287 | 288 | 289 | if (normal_map_enabled == 1.0) 290 | v_normal = vec4(calc_bumped_normal(v_normal.xyz, vec2(t_coords.x, 1.0 - t_coords.y)).xyz, .0); 291 | 292 | float diffuse = max(dot(v_normal.xyz, normalize(light_position_f)), 0.0); 293 | 294 | 295 | if (diffuse < min_light_intensity) diffuse = min_light_intensity; 296 | 297 | /*float cosTheta = dot((normal_mat_frag * normal_vec).xyz, normalize(vec3(0.01, 1., 0.01))); 298 | float bias = 0.005*tan(acos(cosTheta)); 299 | bias = clamp(bias, 0.,shadows_bias);*/ 300 | 301 | float visibility = 1.1; 302 | if (ShadowCoord.x >= 0.0 && ShadowCoord.y >= 0.0 && ShadowCoord.x <= 1.0 && ShadowCoord.y <= 1.0) 303 | for (int i=0;i<4;i++){ 304 | if ( texture2D( texture1, ShadowCoord.xy + poissonDisk[i]/700.0).z < ShadowCoord.z-shadows_bias ){ 305 | visibility-=0.1; 306 | } 307 | } 308 | 309 | 310 | /*if ( texture2D( texture1, ShadowCoord.xy).z < ShadowCoord.z-shadows_bias){ 311 | visibility = 0.5; 312 | } */ 313 | 314 | if (enabled_shadow == 0.0) visibility = 1.0; 315 | float res_alpha = 1.0; 316 | res_alpha = color1.a; 317 | 318 | if (lighting == 0.0) { 319 | visibility = light_intensity.x; 320 | diffuse = 1.0; 321 | } 322 | gl_FragColor = vec4(0, 0, 0, 1.0); 323 | vec4 f_color; 324 | visibility += light_visibility; 325 | 326 | vec4 DiffuseColor = vec4(0, 0, 0, 0); 327 | vec4 SpecularColor = vec4(0, 0, 0, 0); 328 | 329 | //vec3 eye_position_fragx = vec3(-4, 10, -109.7); 330 | vec3 VertexToEye = normalize(eye_position_frag - world_vertex_pos); 331 | vec3 LightReflect = normalize(reflect(vec3(normalize(light_position_f.xyz-world_vertex_pos)), v_normal.xyz)); 332 | 333 | /*vec4 v_light = normalize( vec4(light_position_f, 1.0) - vec4(world_vertex_pos.xyz, 1.0)); 334 | vec3 LightReflect = vec3(1.0, 1.0, 1.0) * pow(max(dot(v_light, vec4(v_normal.xyz,1)), 0.0), 0.9); 335 | SpecularColor = vec4(LightReflect, 1.0);*/ 336 | 337 | vec3 LightReflect2 = normalize(reflect(vec3(normalize(light_orientation_frag.xyz-world_vertex_pos)), v_normal.xyz)); 338 | vec3 LightReflect3 = normalize(reflect(vec3(normalize(light_0_frag.xyz-world_vertex_pos)), v_normal.xyz)); 339 | vec3 LightReflect4 = normalize(reflect(vec3(normalize(light_1_frag.xyz-world_vertex_pos)), v_normal.xyz)); 340 | 341 | float SpecularFactor = dot(VertexToEye, LightReflect); 342 | float SpecularFactor2 = dot(VertexToEye, LightReflect2); 343 | float SpecularFactor3 = dot(VertexToEye, LightReflect3); 344 | float SpecularFactor4 = dot(VertexToEye, LightReflect4); 345 | SpecularFactor = 0.01; 346 | //if (SpecularFactor > 0.0) { 347 | 348 | SpecularFactor = SpecularFactor > 0.0 ? pow(SpecularFactor, specular_power) : 0.0; 349 | SpecularFactor2 = SpecularFactor2 > 0.0 ? pow(SpecularFactor2, specular_power) : 0.0; 350 | SpecularFactor3 = SpecularFactor3 > 0.0 ? pow(SpecularFactor3, specular_power) : 0.0; 351 | SpecularFactor4 = SpecularFactor4 > 0.0 ? pow(SpecularFactor4, specular_power) : 0.0; 352 | 353 | if (SpecularFactor < 0.0) SpecularFactor = 0.0; 354 | if (SpecularFactor2 < 0.0) SpecularFactor2 = 0.0; 355 | if (SpecularFactor3 < 0.0) SpecularFactor3 = 0.0; 356 | if (SpecularFactor4 < 0.0) SpecularFactor4 = 0.0; 357 | 358 | if (SpecularFactor2 < 0.0) SpecularFactor2 = 0.0; 359 | if (SpecularFactor3 < 0.0) SpecularFactor3 = 0.0; 360 | if (SpecularFactor4 < 0.0) SpecularFactor4 = 0.0; 361 | 362 | float spec_result = SpecularFactor+SpecularFactor2+SpecularFactor3+SpecularFactor4; 363 | SpecularColor = vec4(specular_intensity * spec_result, 364 | specular_intensity * spec_result, 365 | specular_intensity * spec_result, 1.0); 366 | //} 367 | 368 | 369 | f_color = vec4((color1).xyz*visibility*diffuse, res_alpha) + SpecularColor; 370 | if (color1.r <= alpha_threshold && color1.g <= alpha_threshold && color1.b <= alpha_threshold) 371 | f_color.a = alpha; 372 | else 373 | f_color.a = 1.0; 374 | f_color += ambient_light; 375 | gl_FragColor = f_color; 376 | 377 | 378 | } 379 | 380 | -------------------------------------------------------------------------------- /kivy3dgui/gles2.0/toonshader/toon_shadows_prev.glsl: -------------------------------------------------------------------------------- 1 | /* simple.glsl 2 | 3 | simple diffuse lighting based on laberts cosine law; see e.g.: 4 | http://en.wikipedia.org/wiki/Lambertian_reflectance 5 | http://en.wikipedia.org/wiki/Lambert%27s_cosine_law 6 | */ 7 | ---VERTEX SHADER------------------------------------------------------- 8 | #ifdef GL_ES 9 | precision highp float; 10 | #endif 11 | 12 | attribute vec3 v_pos; 13 | attribute vec3 v_normal; 14 | attribute vec2 v_tc0; 15 | attribute vec4 blendIndices; 16 | attribute vec4 blendWeights; 17 | 18 | uniform mat4 modelview_mat; 19 | uniform mat4 projection_mat; 20 | uniform mat4 camera; 21 | uniform mat4 matrix_view; 22 | uniform vec2 val_sin; 23 | uniform mat4 depthMVP; 24 | uniform float enabled_shadow; 25 | uniform mat4 normal_mat; 26 | 27 | varying vec4 normal_vec; 28 | varying vec3 vertex_pos; 29 | varying vec2 tex_coord0; 30 | varying vec4 ShadowCoord; 31 | varying vec3 Normal; 32 | varying vec4 lightPosition; 33 | varying float edge; 34 | varying vec3 L; 35 | varying vec3 N; 36 | uniform sampler2D texture0; 37 | uniform sampler2D texture1; 38 | 39 | mat4 depthBiasMVP = mat4(0.5, 0.0, 0.0, 0.0, 40 | 0.0, 0.5, 0.0, 0.0, 41 | 0.0, 0.0, 0.5, 0.0, 42 | 0.5, 0.5, 0.5, 1.0); 43 | 44 | mat4 M = mat4(1.0, 0.0, 0.0, 0.0, 45 | 0.0, 1.0, 0.0, 0.0, 46 | 0.0, 0.0, 1.0, 0.0, 47 | 0.0, 0.0, 0.0, 1.0); 48 | 49 | 50 | void main (void) { 51 | normal_vec = vec4(v_normal,0.0); 52 | vec4 pos = modelview_mat * vec4(v_pos,1.0); 53 | vec3 N = normalize(normal_mat * normal_vec).xyz; 54 | vec3 E = normalize(vec3(0,0,0)-pos.xyz); 55 | //Normal = normalize(gl_NormalMatrix * v_normal).xyz; 56 | #ifdef __GLSL_CG_DATA_TYPES // Fix clipping for Nvidia and ATI 57 | gl_ClipVertex = projection_mat * gl_Vertex; 58 | #endif 59 | //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 60 | float dne = dot(N, E); 61 | edge = dne > 0.0 ? dne : 0.0; 62 | lightPosition = modelview_mat * vec4(0.5, 200, 0, 1); 63 | vec4 e_pos = projection_mat * camera * pos; 64 | tex_coord0 = v_tc0; 65 | ShadowCoord = depthBiasMVP*depthMVP * pos; 66 | //ShadowCoord = depthMVP * pos; 67 | 68 | 69 | // Position of the vertex, in worldspace : M * position 70 | //Position_worldspace = (M*v_pos).xyz; 71 | 72 | // Vector that goes from the vertex to the camera, in camera space. 73 | // In camera space, the camera is at the origin (0,0,0). 74 | vec3 vertexPosition_cameraspace = (pos).xyz; 75 | vec3 EyeDirection_cameraspace = vec3(0,0,0) - vertexPosition_cameraspace; 76 | 77 | // Vector that goes from the vertex to the light, in camera space. M is ommited because it's identity. 78 | vec3 LightPosition_cameraspace = vec4(vec3(0.5, 200, 100),0).xyz; 79 | L = LightPosition_cameraspace + EyeDirection_cameraspace; 80 | //L = LightPosition_cameraspace + EyeDirection_cameraspace; 81 | 82 | // Normal of the the vertex, in camera space 83 | N = ( modelview_mat * vec4(v_normal,0)).xyz; // Only correct if ModelMatrix does not scale the model ! Use its inverse transpose if not. 84 | gl_Position = e_pos; 85 | vertex_pos = e_pos.xyz; 86 | } 87 | 88 | 89 | ---FRAGMENT SHADER----------------------------------------------------- 90 | #ifdef GL_ES 91 | precision highp float; 92 | #endif 93 | 94 | uniform vec2 cond; 95 | 96 | 97 | varying vec4 normal_vec; 98 | varying vec3 vertex_pos; 99 | varying vec2 tex_coord0; 100 | varying float edge; 101 | uniform float enabled_shadow; 102 | uniform float lighting; 103 | uniform float flip_coords; 104 | uniform vec4 light_intensity; 105 | uniform sampler2D texture0; 106 | uniform sampler2D texture1; 107 | 108 | uniform mat4 normal_mat; 109 | varying vec3 Normal; 110 | varying vec4 lightPosition; 111 | varying vec4 ShadowCoord; 112 | uniform vec3 L; 113 | uniform vec3 N; 114 | vec3 LightPosition = vec3(0.5, 50, 100); 115 | vec2 poissonDisk[4]; 116 | 117 | void main (void){ 118 | poissonDisk[0] = vec2( -0.94201624, -0.39906216 ); 119 | poissonDisk[1] = vec2( 0.94558609, -0.76890725 ); 120 | poissonDisk[2] = vec2( -0.094184101, -0.92938870 ); 121 | poissonDisk[3] = vec2( 0.34495938, 0.29387760 ); 122 | vec4 color1 = vec4(1.0,1.0,1.0,1.0); 123 | vec2 t_coords = tex_coord0; 124 | if (int(flip_coords) == 1) 125 | t_coords = vec2(tex_coord0.x, 1.0 - tex_coord0.y); 126 | 127 | 128 | color1 = texture2D( texture0, t_coords ); 129 | vec4 color2; 130 | 131 | vec4 v_normal = normalize( normal_mat * normal_vec ) ; 132 | vec4 v_light = normalize( vec4(0,0,0,1) - vec4(vertex_pos, 1) ); 133 | 134 | float intensity = dot(normalize(LightPosition),v_normal.xyz); 135 | 136 | if (intensity > 0.80) color2 = vec4(1.0, 1.0, 1.0, 1.0); 137 | else if (intensity > 0.75) color2 = vec4(0.8, 0.8, 0.8, 1.0); 138 | else if (intensity > 0.50) color2 = vec4(0.6, 0.6, 0.6, 1.0); 139 | else if (intensity > 0.25) color2 = vec4(0.4, 0.4, 0.4, 1.0); 140 | else color2 = vec4(0.2, 0.2, 0.2, 1.0); 141 | 142 | if (lighting == 0.0) color2 = light_intensity; 143 | 144 | float visibility = 1.1; 145 | vec4 color = texture2D( texture1, ShadowCoord.xy ); 146 | //if ( color.z < ShadowCoord.z-0.01){ 147 | // visibility = 0.3; 148 | //} 149 | for (int i=0;i<4;i++){ 150 | //if ( texture2D( texture1, vec3(ShadowCoord.xy + poissonDisk[i]/700.0, ShadowCoord.z) ).z < ShadowCoord.z-bias ){ 151 | if ( texture2D( texture1, ShadowCoord.xy + poissonDisk[i]/700.0).z < ShadowCoord.z-0.01 ){ 152 | visibility-=0.1; 153 | } 154 | } 155 | /*if (color.z < ShadowCoord.z-0.01) 156 | { 157 | visibility = 0.8; 158 | }*/ 159 | 160 | if (enabled_shadow == 0.0) visibility = 1.0; 161 | float res_alpha = 1.0; 162 | res_alpha = color1.a; 163 | 164 | //visibility += 0.4; 165 | if (edge >= 0.00){ 166 | vec4 f_color; 167 | f_color = vec4((color1 * color2).xyz*visibility, res_alpha); 168 | gl_FragColor = f_color; 169 | } 170 | else 171 | gl_FragColor = vec4(0, 0, 0, 1.0); 172 | 173 | } 174 | 175 | -------------------------------------------------------------------------------- /kivy3dgui/layout3d.py: -------------------------------------------------------------------------------- 1 | """ 2 | The MIT License (MIT) 3 | Copyright (c) 2015-2017 Karel Piorno Charchabal 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | THE SOFTWARE. 19 | """ 20 | 21 | from kivy.clock import Clock 22 | from kivy.uix.floatlayout import FloatLayout 23 | from kivy.uix.image import Image 24 | from kivy3dgui import canvas3d 25 | from kivy3dgui.canvas3d import Canvas3D 26 | from kivy3dgui import effectwidget 27 | from kivy3dgui.effectwidget import BlurEffectWidget 28 | from kivy3dgui.node import Node 29 | from kivy.properties import BooleanProperty, ListProperty, ObjectProperty, NumericProperty, StringProperty 30 | from kivy.graphics import * 31 | from kivy.core.window import Window 32 | from kivy.uix.effectwidget import * 33 | 34 | DEFAULT_SHADER = "toonshader/toon_shadows.glsl" 35 | 36 | # from kivy.graphics.texture import Texture 37 | class EffectBloom(EffectBase): 38 | glsl = StringProperty(""" 39 | vec4 effect( vec4 color, sampler2D bgl_RenderedTexture, vec2 texcoord, vec2 coords) 40 | { 41 | //if (texture2D(texture4, texcoord).x <= 0.50) 42 | // return color; 43 | 44 | vec4 sum = vec4(0); 45 | vec4 return_color; 46 | //vec2 texcoord = vec2(gl_TexCoord[0]); 47 | int j; 48 | int i; 49 | //float glow_threshold = 0.25; 50 | float glow_threshold = 0.15; 51 | //float glow_threshold = time/10.0; 52 | //float r_color = texture2D(texture4, texcoord).x; 53 | 54 | for( i= -4 ;i < 4; i++) 55 | { 56 | for (j = -3; j < 3; j++) 57 | { 58 | sum += texture2D(bgl_RenderedTexture, texcoord + vec2(j, i)*0.004) * glow_threshold; 59 | } 60 | } 61 | if (texture2D(bgl_RenderedTexture, texcoord).r < 0.3) 62 | { 63 | return_color = sum*sum*0.012 + texture2D(bgl_RenderedTexture, texcoord); 64 | } 65 | else 66 | { 67 | if (texture2D(bgl_RenderedTexture, texcoord).r < 0.5) 68 | { 69 | return_color = sum*sum*0.009 + texture2D(bgl_RenderedTexture, texcoord); 70 | } 71 | else 72 | { 73 | return_color = sum*sum*0.0075 + texture2D(bgl_RenderedTexture, texcoord); 74 | } 75 | } 76 | //return_color.a = 1.0; 77 | return return_color; 78 | } 79 | """) 80 | 81 | class Layout3D(FloatLayout): 82 | canvas3d = ObjectProperty(None, allownone=True) 83 | '''canvas3d 84 | ''' 85 | 86 | post_processing = BooleanProperty(False) 87 | '''post_processing 88 | ''' 89 | 90 | shadow = BooleanProperty(True) 91 | '''shadow 92 | ''' 93 | 94 | _nodes = ListProperty([]) 95 | '''_nodes 96 | ''' 97 | 98 | _init_request = [False, False] 99 | '''_init_request 100 | ''' 101 | 102 | look_at = ListProperty([0, 0, 10, 0, 0, 0, 0, 1, 0]) 103 | '''_look_at 104 | ''' 105 | 106 | ambient_light = ListProperty([0, 0, 0, 0]) 107 | '''ambient_light 108 | ''' 109 | 110 | light_intensity = NumericProperty(0.0) 111 | '''ambient_light 112 | ''' 113 | 114 | light_position = ListProperty([-24.5, 120, 95]) 115 | '''light_position 116 | ''' 117 | 118 | light_orientation = ListProperty([0.01, 0.01, 0.01]) 119 | '''light_position 120 | ''' 121 | light_0 = ListProperty([0.01, 0.01, 0.01]) 122 | '''light_0 123 | ''' 124 | 125 | light_1 = ListProperty([0.01, 0.01, 0.01]) 126 | '''light_1 127 | ''' 128 | 129 | _id_stack = ListProperty([]) 130 | 131 | shadow_offset = NumericProperty(0) 132 | 133 | shadow_origin = ListProperty([0, 0, 0]) 134 | 135 | shadow_target = ListProperty([0, -90, -100]) 136 | 137 | shadow_threshold = NumericProperty(1.0) 138 | 139 | canvas_size = ListProperty(Window.size) 140 | 141 | picking_scale = NumericProperty(1.0) 142 | 143 | render_texture = ObjectProperty(None, allownone=True) 144 | '''render_texture 145 | ''' 146 | 147 | effect_widget = ObjectProperty(None, allownone=True) 148 | '''effect_widget 149 | ''' 150 | shader = StringProperty(DEFAULT_SHADER) 151 | 152 | def __init__(self, **kwargs): 153 | 154 | self.canvas_size = kwargs.get("canvas_size", Window.size) 155 | super(Layout3D, self).__init__(**kwargs) 156 | self._trigger_layout = Clock.create_trigger(self.do_layout, -1) 157 | effectwidget.C_SIZE = self.canvas_size 158 | 159 | with self.canvas.before: 160 | Color(1.0, 1.0, 1.0, 1.0) 161 | ClearColor(1.0, 1.0, 1.0, 1.0) 162 | 163 | self.create_canvas() 164 | self.bind(look_at=self.canvas3d.setter('look_at')) 165 | self.bind(shadow_offset=self.canvas3d.setter('_shadow_offset')) 166 | self.bind(shadow_threshold=self.canvas3d.setter('shadow_threshold')) 167 | self.bind(shadow_origin=self.canvas3d.setter('_shadow_pos')) 168 | self.bind(shadow_target=self.canvas3d.setter('_shadow_target')) 169 | self.bind(picking_scale=self.canvas3d.setter('picking_scale')) 170 | self.bind(canvas_size=self.canvas3d.setter('canvas_size')) 171 | self.bind(ambient_light=self.canvas3d.setter('ambient_light')) 172 | self.bind(light_intensity=self.canvas3d.setter('light_intensity')) 173 | self.bind(light_position=self.canvas3d.setter('light_position')) 174 | self.bind(light_orientation=self.canvas3d.setter('light_orientation')) 175 | self.bind(light_0=self.canvas3d.setter('light_0')) 176 | self.bind(light_1=self.canvas3d.setter('light_1')) 177 | self.bind(shader=self.canvas3d.setter('shader')) 178 | 179 | 180 | #self.effect_widget = BlurEffectWidget(mask_effect=self.canvas3d.picking_fbo, 181 | # motion_effect=self.canvas3d.motion_blur_fbo, 182 | # fbo_canvas=self.canvas3d.canvas) 183 | 184 | self.render_texture = Image(size_hint=(1.0, 1.0), 185 | allow_stretch=True, 186 | keep_ratio=False) 187 | self.add_widget(self.render_texture, 100000) 188 | self.render_texture.texture = self.canvas3d.canvas.texture 189 | self.render_texture.texture.mag_filter = 'linear' 190 | self.render_texture.texture.min_filter = 'linear' 191 | 192 | if self._init_request[0]: 193 | self.post_processing = not self._init_request[1] 194 | self.post_processing = self._init_request[1] 195 | self._init_request[0] = True 196 | from kivy3dgui.canvas3d import label, label_debug 197 | label.parent = None 198 | try: 199 | self.add_widget(label) 200 | self.add_widget(label_debug) 201 | except Exception as w: 202 | pass 203 | 204 | self.bind(pos=self.render_texture.setter('pos')) 205 | self.bind(size=self.render_texture.setter('size')) 206 | 207 | def on_canvas_size(self, widget, value): 208 | effectwidget.C_SIZE = value 209 | canvas3d.PICKING_BUFFER_SIZE = value 210 | 211 | def walk(self, value, time): 212 | self.canvas3d.walk(value, time) 213 | 214 | def strafe(self, value, time): 215 | self.canvas3d.strafe(value, time) 216 | 217 | def up(self, value, time): 218 | self.canvas3d.up(value, time) 219 | 220 | def create_canvas(self, *args): 221 | if self.canvas3d is None: 222 | self.canvas3d = Canvas3D(shadow=True, picking=True, size_hint=(1, 1), 223 | canvas_size=self.canvas_size, id="CANVAS3D") 224 | self.add_widget(self.canvas3d) 225 | self.canvas3d.size = self.size 226 | self.canvas3d.size_hint = self.size_hint 227 | 228 | def _add_node(self, *args): 229 | self.canvas3d.add_node(args[0]) 230 | pass 231 | 232 | def on_post_processing(self, widget, value): 233 | if not self._init_request[0]: 234 | self._init_request[0] = True 235 | self._init_request[1] = value 236 | return 237 | 238 | for children in self.children[:]: 239 | if isinstance(children, Canvas3D) or isinstance(children, BlurEffectWidget): 240 | self.remove_widget(children) 241 | 242 | #for children in self.effect_widget.children[:]: 243 | # self.effect_widget.remove_widget(children) 244 | if value: 245 | self.effect_widget = EffectWidget() 246 | self.effect_widget.add_widget(self.canvas3d) 247 | self.effect_widget.effects = [FXAAEffect()] 248 | self.effect_widget.size = (1366, 768) 249 | 250 | effect = Image(size_hint=(1.0, 1.0), 251 | allow_stretch=True, 252 | keep_ratio=False) 253 | effect.texture = self.canvas3d.canvas.texture 254 | self.effect_widget.add_widget(effect) 255 | self.add_widget(self.effect_widget, 100000) 256 | self.remove_widget(self.render_texture) 257 | 258 | effect.texture.mag_filter = 'linear' 259 | effect.texture.min_filter = 'linear' 260 | 261 | self.effect_widget.texture.mag_filter = 'linear' 262 | self.effect_widget.texture.min_filter = 'linear' 263 | 264 | # self.effect_widget.add_widget(self.canvas3d) 265 | # self.effect_widget.effect_mask = self.canvas3d.picking_fbo 266 | # self.add_widget(self.effect_widget) 267 | 268 | else: 269 | if self.effect_widget: 270 | if self.canvas3d in self.effect_widget.children: 271 | self.effect_widget.remove_widget(self.canvas3d) 272 | self.remove_widget(self.effect_widget) 273 | 274 | self.add_widget(self.canvas3d, 100000) 275 | self.add_widget(self.render_texture, 100000) 276 | def add_widget(self, *largs): 277 | widget = largs[0] 278 | 279 | if isinstance(widget, Node): 280 | 281 | # print(widget.fbo_widget) 282 | inc = True 283 | c_id = self.canvas3d.current_id 284 | if self._id_stack: 285 | top = self._id_stack[-1] 286 | c_id = top 287 | self._id_stack.remove(top) 288 | inc = False 289 | float_str = str(c_id)[0:4] 290 | self.canvas3d.fbo_list[float_str] = widget.fbo_widget 291 | widget.pick_id = c_id 292 | 293 | if widget._start_objs: 294 | if widget._objs != []: 295 | widget._start_objs = False 296 | self._add_node(widget) 297 | else: 298 | widget.parent = self.canvas3d 299 | try: 300 | self._nodes.append(widget.__self__) 301 | pass 302 | except: 303 | self._nodes.append(widget) 304 | pass 305 | 306 | self.canvas3d.add_widget(widget.fbo_widget) 307 | """Check the increment""" 308 | if inc: 309 | self.canvas3d.current_id += 0.01 310 | self.canvas3d.current_id = round(self.canvas3d.current_id, 2) 311 | return None 312 | else: 313 | ret = super(Layout3D, self).add_widget(*largs) 314 | return ret 315 | 316 | def get_nodes(self): 317 | return self.canvas3d.nodes 318 | 319 | def remove_widget(self, widget): 320 | if isinstance(widget, Node): 321 | if widget in self._nodes: 322 | self._nodes.remove(widget) 323 | float_str = str(widget.pick_id)[0:4] 324 | if float_str in self.canvas3d.fbo_list: 325 | # self.canvas3d.fbo_list.remove(float_str) 326 | self.canvas3d.fbo_list.pop(float_str) 327 | 328 | id = widget.pick_id 329 | self._id_stack.append(id) 330 | self.canvas3d._remove_node(widget) 331 | else: 332 | super(Layout3D, self).remove_widget(widget) 333 | 334 | def on_touch_down(self, *args): 335 | self.canvas3d.last_widget_str = "NONE" 336 | return super(Layout3D, self).on_touch_down(*args) 337 | 338 | def on_touch_up(self, touch): 339 | ret = False 340 | for e in self.children: 341 | if not isinstance(e, Image): 342 | if e.collide_point(touch.x, touch.y): 343 | ret = e.on_touch_up(touch) 344 | break 345 | return ret 346 | -------------------------------------------------------------------------------- /kivy3dgui/objloader.py: -------------------------------------------------------------------------------- 1 | from kivy.logger import Logger 2 | import os 3 | 4 | 5 | class MeshData(object): 6 | def __init__(self, **kwargs): 7 | self.name = kwargs.get("name") 8 | self.vertex_format = [ 9 | ('v_pos', 3, 'float'), 10 | ('v_normal', 3, 'float'), 11 | ('v_tc0', 2, 'float')] 12 | self.vertices = [] 13 | self.indices = [] 14 | 15 | def calculate_normals(self): 16 | for i in range(len(self.indices) / (3)): 17 | fi = i * 3 18 | v1i = self.indices[fi] 19 | v2i = self.indices[fi + 1] 20 | v3i = self.indices[fi + 2] 21 | 22 | vs = self.vertices 23 | p1 = [vs[v1i + c] for c in range(3)] 24 | p2 = [vs[v2i + c] for c in range(3)] 25 | p3 = [vs[v3i + c] for c in range(3)] 26 | 27 | u,v = [0,0,0], [0,0,0] 28 | for j in range(3): 29 | v[j] = p2[j] - p1[j] 30 | u[j] = p3[j] - p1[j] 31 | 32 | n = [0,0,0] 33 | n[0] = u[1] * v[2] - u[2] * v[1] 34 | n[1] = u[2] * v[0] - u[0] * v[2] 35 | n[2] = u[0] * v[1] - u[1] * v[0] 36 | 37 | for k in range(3): 38 | self.vertices[v1i + 3 + k] = n[k] 39 | self.vertices[v2i + 3 + k] = n[k] 40 | self.vertices[v3i + 3 + k] = n[k] 41 | 42 | 43 | class ObjFile: 44 | def finish_object(self): 45 | if self._current_object == None: 46 | return 47 | 48 | mesh = [MeshData()] 49 | cont_mesh=0 50 | idx = 0 51 | for f in self.faces: 52 | verts = f[0] 53 | norms = f[1] 54 | tcs = f[2] 55 | material_ = list(map(float, f[3])) 56 | 57 | if len(mesh[cont_mesh].indices) == 65535: 58 | mesh.append(MeshData()) 59 | cont_mesh+=1 60 | idx=0 61 | 62 | for i in range(3): 63 | #get normal components 64 | n = (0.0, 0.0, 0.0) 65 | if norms[i] != -1: 66 | n = self.normals[norms[i]-1] 67 | 68 | #get texture coordinate components 69 | t = (0.4, 0.4) 70 | if tcs[i] != -1: 71 | t = self.texcoords[tcs[i]-1] 72 | 73 | #get vertex components 74 | v = self.vertices[verts[i]-1] 75 | 76 | data = [v[0], v[1], v[2], n[0], n[1], n[2], t[0], t[1], material_[0], material_[1], material_[2]] 77 | mesh[cont_mesh].vertices.extend(data) 78 | 79 | 80 | 81 | tri = [idx, idx+1, idx+2] 82 | mesh[cont_mesh].indices.extend(tri) 83 | idx += 3 84 | 85 | self.objects[self._current_object] = mesh 86 | #mesh.calculate_normals() 87 | self.faces = [] 88 | 89 | def __init__(self, filename, swapyz=False): 90 | """Loads a Wavefront OBJ file. """ 91 | self.objects = {} 92 | self.vertices = [] 93 | self.normals = [] 94 | self.texcoords = [] 95 | self.faces = [] 96 | self.mtl = None 97 | 98 | self._current_object = None 99 | 100 | material = None 101 | 102 | for line in open(filename, "r"): 103 | if line.startswith('#'): continue 104 | if line.startswith('s'): continue 105 | values = line.split() 106 | if not values: continue 107 | if values[0] == 'o': 108 | self.finish_object() 109 | self._current_object = values[1] 110 | elif values[0] == 'mtllib': 111 | mtl_path = mtl_filename = values[1] 112 | if (os.path.isabs(filename) and not os.path.isabs(mtl_filename)) or \ 113 | (os.path.dirname(filename) and not os.path.dirname(mtl_filename)): 114 | # if needed, correct the mtl path to be relative or same-dir to/as the object path 115 | mtl_path = os.path.join(os.path.dirname(filename), mtl_filename) 116 | self.mtl = MTL(mtl_path) 117 | elif values[0] in ('usemtl', 'usemat'): 118 | material = values[1] 119 | if values[0] == 'v': 120 | v = list(map(float, values[1:4])) 121 | if swapyz: 122 | v = v[0], v[2], v[1] 123 | self.vertices.append(v) 124 | elif values[0] == 'vn': 125 | v = list(map(float, values[1:4])) 126 | if swapyz: 127 | v = v[0], v[2], v[1] 128 | self.normals.append(v) 129 | elif values[0] == 'vt': 130 | self.texcoords.append(list(map(float, values[1:3]))) 131 | elif values[0] == 'f': 132 | face = [] 133 | texcoords = [] 134 | norms = [] 135 | for v in values[1:]: 136 | w = v.split('/') 137 | face.append(int(w[0])) 138 | if len(w) >= 2 and len(w[1]) > 0: 139 | texcoords.append(int(w[1])) 140 | else: 141 | texcoords.append(-1) 142 | if len(w) >= 3 and len(w[2]) > 0: 143 | norms.append(int(w[2])) 144 | else: 145 | norms.append(-1) 146 | self.faces.append((face, norms, texcoords, self.mtl[material]["Kd"] if self.mtl!=None else [1., 1., 1.])) 147 | self.finish_object() 148 | 149 | 150 | def MTL(filename): 151 | contents = {} 152 | mtl = None 153 | if not os.path.exists(filename): 154 | return 155 | for line in open(filename, "r"): 156 | if line.startswith('#'): continue 157 | values = line.split() 158 | if not values: continue 159 | if values[0] == 'newmtl': 160 | mtl = contents[values[1]] = {} 161 | elif mtl is None: 162 | raise ValueError("mtl file doesn't start with newmtl stmt") 163 | mtl[values[0]] = values[1:] 164 | return contents 165 | -------------------------------------------------------------------------------- /meshes/2dbox.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 06.12.2014 10:23:07 3 | 4 | mtllib 2dbox.mtl 5 | 6 | # 7 | # object Box01 8 | # 9 | o 2DBox 10 | v -78.2906 -60.3419 -0.0000 11 | v -78.2906 59.6581 0.0000 12 | v 81.7094 59.6581 0.0000 13 | v 81.7094 -60.3419 -0.0000 14 | v -78.2906 -60.3419 1.0000 15 | v 81.7094 -60.3419 1.0000 16 | v 81.7094 59.6581 1.0000 17 | v -78.2906 59.6581 1.0000 18 | # 8 vertices 19 | 20 | vn 0.0000 0.0000 -1.0000 21 | vn 0.0000 -0.0000 1.0000 22 | vn 0.0000 -1.0000 -0.0000 23 | vn 1.0000 0.0000 -0.0000 24 | vn 0.0000 1.0000 0.0000 25 | vn -1.0000 0.0000 -0.0000 26 | # 6 vertex normals 27 | 28 | vt 0.0005 0.0005 0.5000 29 | vt 0.0005 0.9995 0.5000 30 | vt 0.9995 0.9995 0.5000 31 | vt 0.9995 0.0005 0.5000 32 | vt 0.0005 0.0005 1.5000 33 | vt 0.9995 0.0005 1.5000 34 | vt 0.9995 0.9995 1.5000 35 | vt 0.0005 0.9995 1.5000 36 | # 8 texture coords 37 | 38 | g Box01 39 | usemtl 01___Default 40 | s 2 41 | f 1/1/1 2/2/1 3/3/1 42 | f 3/3/1 4/4/1 1/1/1 43 | s 4 44 | f 5/5/2 6/6/2 7/7/2 45 | f 7/7/2 8/8/2 5/5/2 46 | s 8 47 | f 1/1/3 4/4/3 6/6/3 48 | f 6/6/3 5/5/3 1/1/3 49 | s 16 50 | f 4/4/4 3/3/4 7/7/4 51 | f 7/7/4 6/6/4 4/4/4 52 | s 32 53 | f 3/3/5 2/2/5 8/8/5 54 | f 8/8/5 7/7/5 3/3/5 55 | s 64 56 | f 2/2/6 1/1/6 5/5/6 57 | f 5/5/6 8/8/6 2/2/6 58 | # 12 faces 59 | 60 | -------------------------------------------------------------------------------- /meshes/box.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 26.10.2017 23:41:35 3 | 4 | newmtl Material 5 | Ns 10.0000 6 | Ni 1.5000 7 | d 1.0000 8 | Tr 0.0000 9 | Tf 1.0000 1.0000 1.0000 10 | illum 2 11 | Ka 0.5880 0.5880 0.5880 12 | Kd 0.5880 0.5880 0.5880 13 | Ks 0.0000 0.0000 0.0000 14 | Ke 0.0000 0.0000 0.0000 15 | map_Ka D:\Mem\@KYVY\3DEditor\imgs\box_texture.png 16 | map_Kd D:\Mem\@KYVY\3DEditor\imgs\box_texture.png 17 | -------------------------------------------------------------------------------- /meshes/box.obj: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware 2 | # File Created: 26.10.2017 23:41:35 3 | 4 | mtllib box.mtl 5 | 6 | # 7 | o default 8 | # 9 | 10 | v 1.0000 -1.0000 1.0000 11 | v -1.0000 -1.0000 1.0000 12 | v -1.0000 -1.0000 -1.0000 13 | v -1.0000 1.0000 -1.0000 14 | v -1.0000 1.0000 1.0000 15 | v 1.0000 1.0000 1.0000 16 | v 1.0000 1.0000 -1.0000 17 | v 1.0000 -1.0000 -1.0000 18 | # 8 vertices 19 | 20 | vn 0.0000 -1.0000 -0.0000 21 | vn 0.0000 1.0000 -0.0000 22 | vn 1.0000 0.0000 -0.0000 23 | vn 0.0000 0.0000 1.0000 24 | vn -1.0000 0.0000 -0.0000 25 | vn 0.0000 0.0000 -1.0000 26 | # 6 vertex normals 27 | 28 | vt 0.6506 0.9066 0.0000 29 | vt 0.6506 0.0804 0.0000 30 | vt 0.5153 0.0804 0.0000 31 | vt 0.1958 0.0916 0.0000 32 | vt 0.3227 0.0916 0.0000 33 | vt 0.3227 0.8666 0.0000 34 | vt 0.0170 0.9254 0.0000 35 | vt 0.1585 0.9254 0.0000 36 | vt 0.1585 0.0615 0.0000 37 | vt 0.8219 0.9416 0.0000 38 | vt 0.8219 0.0542 0.0000 39 | vt 0.6822 0.0542 0.0000 40 | vt 0.4848 0.1160 0.0000 41 | vt 0.4848 0.8710 0.0000 42 | vt 0.3611 0.8710 0.0000 43 | vt 0.8586 0.8820 0.0000 44 | vt 0.8586 0.1270 0.0000 45 | vt 0.9823 0.1270 0.0000 46 | vt 0.5166 0.8985 0.0000 47 | vt 0.1958 0.8666 0.0000 48 | vt 0.0170 0.0615 0.0000 49 | vt 0.6836 0.9329 0.0000 50 | vt 0.3611 0.1160 0.0000 51 | vt 0.9823 0.8820 0.0000 52 | # 24 texture coords 53 | 54 | g default 55 | usemtl Material 56 | s off 57 | f 1/1/1 2/2/1 3/3/1 58 | f 4/4/2 5/5/2 6/6/2 59 | f 7/7/3 6/8/3 1/9/3 60 | f 6/10/4 5/11/4 2/12/4 61 | f 2/13/5 5/14/5 4/15/5 62 | f 8/16/6 3/17/6 4/18/6 63 | f 8/19/1 1/1/1 3/3/1 64 | f 7/20/2 4/4/2 6/6/2 65 | f 8/21/3 7/7/3 1/9/3 66 | f 1/22/4 6/10/4 2/12/4 67 | f 3/23/5 2/13/5 4/15/5 68 | f 7/24/6 8/16/6 4/18/6 69 | # 12 faces 70 | 71 | -------------------------------------------------------------------------------- /screenshots/3DEditor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/screenshots/3DEditor.gif -------------------------------------------------------------------------------- /screenshots/screenshot1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/screenshots/screenshot1.jpg -------------------------------------------------------------------------------- /screenshots/screenshot2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kpiorno/kivy3dgui/9af2b6fd4233bf3d8fe1bb6a02b8a674cfa53210/screenshots/screenshot2.jpg -------------------------------------------------------------------------------- /tour3d.py: -------------------------------------------------------------------------------- 1 | from kivy.app import App 2 | from kivy.uix.button import Button 3 | from kivy.uix.floatlayout import FloatLayout 4 | from kivy.uix.textinput import TextInput 5 | from kivy.uix.button import Button 6 | from kivy.uix.scatter import Scatter 7 | from kivy.uix.image import Image 8 | from kivy.animation import Animation 9 | from kivy.clock import Clock 10 | from kivy3dgui.layout3d import Node 11 | 12 | class Note(Scatter): 13 | def __init__(self, **kwargs): 14 | wpos = self.pos = kwargs.pop("pos") 15 | try: 16 | self.create_image = kwargs.pop("create_image") 17 | super(Note, self).__init__(**kwargs) 18 | except: 19 | print(kwargs) 20 | self.opacity = 0 21 | #Show 22 | anim = Animation(opacity=1.0, duration=0.3) 23 | anim.start(self) 24 | create_image = kwargs.get('create_image', False) 25 | 26 | self.request_del = False 27 | text_editor = TextInput(size = (120, 90)) 28 | close = Button(size = (20, 20), text="x") 29 | image = Image(source="./data/imgs/background.jpg", allow_stretch=True, keep_ratio=False) 30 | 31 | self.add_widget(image) 32 | self.add_widget(text_editor) 33 | self.add_widget(close) 34 | 35 | if create_image: 36 | image_front = Image(source="./data/imgs/faust_github.jpg", size=(120,70), allow_stretch=True, keep_ratio=False) 37 | self.add_widget(image_front) 38 | 39 | self.size = (120, 120) 40 | self.size_hint = (None, None) 41 | image.size = (120, 120) 42 | text_editor.pos = (0, 10) 43 | close.pos = (100, 100) 44 | self.pos = wpos 45 | 46 | close.bind(on_release=self.close_request) 47 | 48 | def close_request(self, *args): 49 | if not self.request_del: 50 | anim = Animation(opacity=0.0, duration=0.3) 51 | anim.bind(on_complete=self.on_complete) 52 | anim.start(self) 53 | self.request_del = True 54 | 55 | def on_complete(self, *args): 56 | self.parent.remove_widget(self) 57 | 58 | class Tour3DApp(App): 59 | def create_note(self, args): 60 | self.create_image = not self.create_image 61 | return Note(pos=(args[0]-4, args[1]-102), create_image = self.create_image) 62 | 63 | def speed_event(self): 64 | self.show_speed_control = not self.show_speed_control 65 | if self.show_speed_control: 66 | Animation(translate=(16, 15, -10), scale=(0.07, 0.07, 0.07), duration=0.4).start(self.layout3d.ids["SpeedInc"]) 67 | Animation(translate=(12, 15, -10), scale=(0.07, 0.07, 0.07), duration=0.4).start(self.layout3d.ids["SpeedDec"]) 68 | else: 69 | Animation(translate=(14, 15, -10), scale=(0.07, 0.07, 0.07), duration=0.4).start(self.layout3d.ids["SpeedInc"]) 70 | Animation(translate=(14, 15, -10), scale=(0.07, 0.07, 0.07), duration=0.4).start(self.layout3d.ids["SpeedDec"]) 71 | self.rot_speed = 14.0 72 | 73 | def add_speed(self, value): 74 | self.rot_speed += value 75 | 76 | def build(self): 77 | from kivy.lang import Builder 78 | self.create_image = False 79 | self.rot_speed = 14.0 80 | self.show_speed_control = False 81 | self.rotating = True 82 | self.delay = 8.0 83 | self.red_n = [] 84 | self.green_n = [] 85 | self.layout3d = Builder.load_string(''' 86 | #:kivy 1.0 87 | #: import Layout3D kivy3dgui.layout3d 88 | #: import Animation kivy.animation.Animation 89 | 90 | 91 | 92 | Layout3D: 93 | id: par 94 | size_hint: (1.0, 1.0) 95 | canvas_size: (1366, 768) 96 | post_processing: False 97 | shadow: False 98 | canvas.before: 99 | Color: 100 | rgb: 1, 1, 1,0.1 101 | Rectangle: 102 | size: self.size 103 | pos: self.pos 104 | #source: "./data/imgs/checkerb.png" 105 | Node: 106 | rotate: (90.0, 1.0, 0, 0) 107 | scale: (80.0,80.0,0.1) 108 | translate: (0, -25, -110) 109 | effect: True 110 | picking: False 111 | meshes: ("./data/obj/box.obj", ) 112 | FloatLayout: 113 | size_hint: (1.0, 1.0) 114 | Button: 115 | background_normal: "./data/imgs/checkerb.png" 116 | 117 | Node: 118 | #rotate: (-90.0, 1.0, 0, 0) 119 | scale: (0.1,0.1,0.1) 120 | translate: (0, -18, -12) 121 | effect: True 122 | picking: False 123 | meshes: ("./data/obj/sphere.obj", ) 124 | FloatLayout: 125 | size_hint: (1.0, 1.0) 126 | Button: 127 | background_normal: "./data/imgs/green.png" 128 | Node: 129 | #rotate: (30.0, 0.0, 0, 1.0) 130 | id: FarSphere 131 | scale: (0.3,0.3,0.3) 132 | translate: (-10, 10, -170) 133 | effect: True 134 | meshes: ("./data/obj/sphere.obj", ) 135 | FloatLayout: 136 | size_hint: (1.0, 1.0) 137 | id: NoteLayout 138 | Button: 139 | size_hint: (1.0, 1.0) 140 | background_normal: "./data/imgs/worldtex.png" 141 | on_touch_down: 142 | Animation(translate=(2, 8, -17), scale=(0.45, 0.45, 0.45), duration=2.3).start(FarSphere) 143 | Animation(look_at = [0, 15, 20, 0, 14, -20, 0, 1, 0], duration=2.3).start(root) 144 | NoteLayout.add_widget(app.create_note((args[1].x, args[1].y))) 145 | Animation(translate= (20, -10, -48),duration=2.3).start(Drawer2) 146 | 147 | Slider: 148 | size_hint: (1.0, 0.05) 149 | pos_hint: {"x": 0.0, "y":0.5} 150 | opacity: 0.3 151 | 152 | 153 | 154 | Node: 155 | rotate: (310.0, 0.0, 1, 0) 156 | id: Sheet1 157 | scale: (0.15,0.15,0.15) 158 | translate: (-10, 14, -10) 159 | effect: True 160 | meshes: ("./data/obj/sphere.obj", ) 161 | FloatLayout: 162 | size_hint: (1.0, 1.0) 163 | 164 | Button: 165 | text: "Rotate" 166 | size_hint: (0.3, 0.2) 167 | font_size: 80 168 | pos_hint: {"x": 0, "y":0.4} 169 | on_release: 170 | anim = Animation(rotate=(310, 0, 1, 0), duration=0.3) 171 | anim.start(Sheet1) 172 | app.rotating = True 173 | Button: 174 | text: "Stop" 175 | size_hint: (0.3, 0.2) 176 | font_size: 80 177 | pos_hint: {"x": 0.5, "y":0.4} 178 | on_release: 179 | anim = Animation(rotate=(130, 0, 1, 0), duration=0.3) 180 | anim.start(Sheet1) 181 | app.rotating = False 182 | 183 | Node: 184 | rotate: (290.0, 0.0, 1, 0) 185 | id: Speed 186 | scale: (0.11,0.11,0.11) 187 | translate: (14, 14, -10) 188 | effect: True 189 | meshes: ("./data/obj/sphere.obj", ) 190 | FloatLayout: 191 | size_hint: (1.0, 1.0) 192 | 193 | Button: 194 | text: "Speed" 195 | size_hint: (0.3, 0.2) 196 | font_size: 80 197 | pos_hint: {"x": 0.5, "y":0.4} 198 | on_release: 199 | app.speed_event() 200 | Node: 201 | rotate: (290.0, 0.0, 1, 0) 202 | id: SpeedInc 203 | scale: (0.07,0.07,0.07) 204 | translate: (14, 15, -10) 205 | effect: True 206 | meshes: ("./data/obj/sphere.obj", ) 207 | FloatLayout: 208 | size_hint: (1.0, 1.0) 209 | 210 | Button: 211 | text: ">>" 212 | size_hint: (0.3, 0.2) 213 | font_size: 80 214 | pos_hint: {"x": 0.5, "y":0.4} 215 | on_release: 216 | app.add_speed(14.0) 217 | 218 | Node: 219 | rotate: (290.0, 0.0, 1, 0) 220 | id: SpeedDec 221 | scale: (0.07,0.07,0.07) 222 | translate: (14, 15, -10) 223 | effect: True 224 | meshes: ("./data/obj/sphere.obj", ) 225 | FloatLayout: 226 | size_hint: (1.0, 1.0) 227 | 228 | Button: 229 | text: "<<" 230 | size_hint: (0.3, 0.2) 231 | font_size: 80 232 | pos_hint: {"x": 0.5, "y":0.4} 233 | on_release: 234 | app.add_speed(-14.0) 235 | 236 | Node: 237 | #rotate: (-90.0, 1.0, 0, 0) 238 | scale: (8.4,8.4,8.4) 239 | translate: (0, -10, -40) 240 | effect: True 241 | meshes: ("./data/obj/table.obj", ) 242 | FloatLayout: 243 | size_hint: (1.0, 1.0) 244 | Button: 245 | background_normal: "./data/imgs/table.png" 246 | 247 | Node: 248 | #rotate: (-90.0, 1.0, 0, 0) 249 | scale: (8.4,8.4,8.4) 250 | translate: (0, -10, -48) 251 | effect: True 252 | picking: False 253 | meshes: ("./data/obj/drawer.obj", ) 254 | FloatLayout: 255 | size_hint: (1.0, 1.0) 256 | Button: 257 | background_normal: "./data/imgs/drawer.png" 258 | 259 | Node: 260 | #rotate: (-90.0, 1.0, 0, 0) 261 | scale: (8.4,8.4,8.4) 262 | id: Drawer2 263 | translate: (20, -10, -48) 264 | effect: True 265 | picking: False 266 | meshes: ("./data/obj/drawer.obj", ) 267 | FloatLayout: 268 | size_hint: (1.0, 1.0) 269 | id: SelfDrawer 270 | Button: 271 | background_normal: "./data/imgs/drawer.png" 272 | on_release: 273 | Animation(look_at = [0, 15, 16, 0, 12, 0, 0, 1, 0], duration=2.3).start(root) 274 | Animation(translate= (20, -10, -40),duration=2.3).start(Drawer2) 275 | 276 | 277 | 278 | ''') 279 | 280 | """rotate= (120.0, 0.0, 1.0, 0.4),""" 281 | self.layout3d.look_at = [0, 15, 86, 0, 8, 0, 0, 1, 0] 282 | self.y_rotate = 0.0 283 | Clock.schedule_interval(self.update_time, 1 / 60.) 284 | 285 | return self.layout3d 286 | 287 | def update_time(self, delta): 288 | if self.rotating: 289 | self.y_rotate += delta * self.rot_speed 290 | self.layout3d.ids["FarSphere"].rotate = [self.y_rotate, 0.0, 1.0, 0.0] 291 | 292 | 293 | if __name__ == '__main__': 294 | Tour3DApp().run() 295 | --------------------------------------------------------------------------------