File tree Expand file tree Collapse file tree 3 files changed +23
-7
lines changed
Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ PyWavefront
33
44This python module allows you to read Wavefront 3D object files
55(` something.obj ` and ` something.mtl ` ) and use them as Python objects.
6- Currently Pyglet is required to render and display these objects.
6+ If you optionally want to render and display these objects, Pyglet is required .
77
88Currently, only a subset of [ the defined
99specification] ( https://en.wikipedia.org/wiki/Wavefront_.obj_file ) has
1010been implemented.
1111
12- Requirements
12+ Optional Dependencies
1313------------
1414
1515* [ Pyglet] ( http://www.pyglet.org/ )
@@ -19,14 +19,29 @@ Usage
1919
2020### From Python
2121
22- import pywavefront
23- meshes = pywavefront.Wavefront('something.obj')
24- meshes.draw()
22+ ** Basic**
23+
24+ ``` python
25+ import pywavefront
26+ meshes = pywavefront.Wavefront(' something.obj' )
27+ ```
28+
29+ ** Visualization**
30+
31+ ``` python
32+ import pywavefront
33+
34+ [create a window and set up your OpenGl context]
35+ meshes = pywavefront.Wavefront(' something.obj' )
36+
37+ [inside your drawing loop]
38+ meshes.draw()
39+ ```
2540
2641### Example Script
2742
2843There are two pyglet example scripts with included ` .obj ` and ` .mtl ` files in the ` example ` directory. To run them, change to the ` example `
29- directory and run either ` ./pyglet_demo.py ` or ` .pyglet_demo2.py ` .
44+ directory and run either ` ./pyglet_demo.py ` or ` .pyglet_demo2.py ` . Pyglet is required for these.
3045
3146### Generating a Wavefront file with Blender
3247
Original file line number Diff line number Diff line change 77import pyglet
88from pyglet .gl import *
99
10- import pywavefront
10+ import pywavefront . visualization
1111
1212rotation = 0
1313
Original file line number Diff line number Diff line change 99from pyglet .gl import *
1010
1111from pywavefront import Wavefront
12+ import pywavefront .visualization
1213
1314rotation = 0
1415
You can’t perform that action at this time.
0 commit comments