Author: ArcRiley
Date: 2007-07-08 16:27:20 -0400 (Sun, 08 Jul 2007)
New Revision: 427
Removed:
trunk/pysoy/src/bodies._bodies/Mesh.pxi
Modified:
trunk/pysoy/scripts/__init__.py
trunk/pysoy/scripts/bodies/__init__.py
trunk/pysoy/setup.py
trunk/pysoy/src/_datatypes/FaceList.pxi
trunk/pysoy/src/_datatypes/VertexList.pxi
trunk/pysoy/src/_datatypes/soy._datatypes.pyx
trunk/pysoy/src/atoms/Face.pxi
trunk/pysoy/src/atoms/Vertex.pxi
trunk/pysoy/src/atoms/soy.atoms.pxd
trunk/pysoy/src/bodies._bodies/Body.pxi
trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd
trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pyx
trunk/pysoy/src/meshes/Mesh.pxi
trunk/pysoy/src/meshes/soy.meshes.pxd
trunk/pysoy/src/widgets/soy.widgets.pxd
trunk/pysoy/tests/lit_pyramid.py
trunk/pysoy/tests/tex_pyramid.py
trunk/pysoy/tests/vid_pyramid.py
Log:
Finished ticket #277 (so soon?)
Modified: trunk/pysoy/scripts/__init__.py
===================================================================
--- trunk/pysoy/scripts/__init__.py 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/scripts/__init__.py 2007-07-08 20:27:20 UTC (rev 427)
@@ -25,6 +25,7 @@
import bodies
import colors
import materials
+import meshes
import textures
import transports
import widgets
Modified: trunk/pysoy/scripts/bodies/__init__.py
===================================================================
--- trunk/pysoy/scripts/bodies/__init__.py 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/scripts/bodies/__init__.py 2007-07-08 20:27:20 UTC (rev
427)
@@ -17,7 +17,7 @@
#
# $Id$
-from _bodies import Body, Camera, Mesh, Pyramid, \
+from _bodies import Body, Camera, \
__author__, __credits__, __date__, __doc__, __version__
import fields
import joints
Modified: trunk/pysoy/setup.py
===================================================================
--- trunk/pysoy/setup.py 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/setup.py 2007-07-08 20:27:20 UTC (rev 427)
@@ -35,6 +35,7 @@
'bodies.lights' : ['GL','ode'],
'colors' : ['GL'],
'materials' : ['GL'],
+ 'meshes' : ['GLEW','GL','ode'],
'textures' : ['GLEW','GL', 'ogg', 'theora'],
'shapes' : ['ode'],
'transports' : ['ogg'],
Modified: trunk/pysoy/src/_datatypes/FaceList.pxi
===================================================================
--- trunk/pysoy/src/_datatypes/FaceList.pxi 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/src/_datatypes/FaceList.pxi 2007-07-08 20:27:20 UTC (rev
427)
@@ -23,8 +23,8 @@
This is a list-like container class for the faces of a soy.bodies.Mesh
'''
def __new__(self, mesh) :
- if not isinstance(mesh, soy.bodies._bodies.Mesh) :
- raise TypeError('argument must be of type soy.bodies.Mesh')
+ if not isinstance(mesh, soy.meshes.Mesh) :
+ raise TypeError('argument must be of type soy.meshes.Mesh')
self._mesh = <void *> mesh
self._children = soy._internals.Children()
@@ -59,7 +59,7 @@
break
self._children.unlock()
if not _found :
- _face = soy.atoms.Face(mesh = <soy.bodies._bodies.Mesh> self._mesh,
+ _face = soy.atoms.Face(mesh = <soy.meshes.Mesh> self._mesh,
index= _index)
return _face
@@ -111,7 +111,7 @@
cdef void _allocArray(self, int num) :
- cdef soy.bodies._bodies.Mesh _mesh
- _mesh = <soy.bodies._bodies.Mesh> self._mesh
+ cdef soy.meshes.Mesh _mesh
+ _mesh = <soy.meshes.Mesh> self._mesh
self._array = <Face *> _mesh._alloc(num, &self._arrayAlloc,
self._array, sizeof(Face))
Modified: trunk/pysoy/src/_datatypes/VertexList.pxi
===================================================================
--- trunk/pysoy/src/_datatypes/VertexList.pxi 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/src/_datatypes/VertexList.pxi 2007-07-08 20:27:20 UTC (rev
427)
@@ -27,7 +27,7 @@
This is a list-like container class for shared vertices.
'''
def __new__(self, mesh) :
- if not isinstance(mesh, soy.bodies._bodies.Mesh) :
+ if not isinstance(mesh, soy.meshes.Mesh) :
raise TypeError('argument must be of type soy.bodies.Mesh')
self._mesh = <void *> mesh
self._children = soy._internals.Children()
@@ -40,7 +40,7 @@
def __str__(self) :
cdef int i
cdef object l
- cdef soy.bodies._bodies.Mesh _mesh
+ cdef soy.meshes.Mesh _mesh
l = []
self._children.lock()
for i from 0 <= i < self._arraySize :
@@ -79,7 +79,7 @@
break
self._children.unlock()
if not _found :
- _vert = soy.atoms.Vertex(mesh = <soy.bodies._bodies.Mesh> self._mesh,
+ _vert = soy.atoms.Vertex(mesh = <soy.meshes.Mesh> self._mesh,
index= _index)
return _vert
@@ -135,7 +135,7 @@
cdef void _allocArray(self, int num) :
- cdef soy.bodies._bodies.Mesh _mesh
- _mesh = <soy.bodies._bodies.Mesh> self._mesh
+ cdef soy.meshes.Mesh _mesh
+ _mesh = <soy.meshes.Mesh> self._mesh
self._array = <Vert *> _mesh._alloc(num, &self._arrayAlloc,
self._array, sizeof(Vert))
Modified: trunk/pysoy/src/_datatypes/soy._datatypes.pyx
===================================================================
--- trunk/pysoy/src/_datatypes/soy._datatypes.pyx 2007-07-08 20:15:07 UTC
(rev 426)
+++ trunk/pysoy/src/_datatypes/soy._datatypes.pyx 2007-07-08 20:27:20 UTC
(rev 427)
@@ -27,7 +27,7 @@
__version__ = 'Trunk (r'+'$Rev$'[6:-2]+')'
cimport soy.atoms
-cimport soy.bodies._bodies
+cimport soy.meshes
include "HashTable.pxi"
include "FaceList.pxi"
Modified: trunk/pysoy/src/atoms/Face.pxi
===================================================================
--- trunk/pysoy/src/atoms/Face.pxi 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/src/atoms/Face.pxi 2007-07-08 20:27:20 UTC (rev 427)
@@ -22,7 +22,7 @@
An element of FaceList with .verts property
'''
- def __new__(self, soy.bodies._bodies.Mesh mesh,
+ def __new__(self, soy.meshes.Mesh mesh,
verts=None,
index=-1, *args, **keywords) :
self._index = -1
@@ -64,7 +64,7 @@
cdef float a, b, c
cdef object t
cdef soy._datatypes.VertexList _verts
- _verts = (<soy.bodies._bodies.Mesh> self._list._mesh)._verts
+ _verts = (<soy.meshes.Mesh> self._list._mesh)._verts
self._list._children.lock()
t = (_verts[self._list._array[self._index].a],
_verts[self._list._array[self._index].b],
Modified: trunk/pysoy/src/atoms/Vertex.pxi
===================================================================
--- trunk/pysoy/src/atoms/Vertex.pxi 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/src/atoms/Vertex.pxi 2007-07-08 20:27:20 UTC (rev 427)
@@ -22,7 +22,7 @@
An element of VertexList with .position .normal and .texcoord properties
'''
- def __new__(self, soy.bodies._bodies.Mesh mesh,
+ def __new__(self, soy.meshes.Mesh mesh,
position=None, normal=None, texcoord=None,
index=-1, *args, **keywords) :
self._index = -1
Modified: trunk/pysoy/src/atoms/soy.atoms.pxd
===================================================================
--- trunk/pysoy/src/atoms/soy.atoms.pxd 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/src/atoms/soy.atoms.pxd 2007-07-08 20:27:20 UTC (rev 427)
@@ -19,7 +19,7 @@
cimport stdio
cimport soy._internals
-cimport soy.bodies._bodies
+cimport soy.meshes
cimport soy.materials
Modified: trunk/pysoy/src/bodies._bodies/Body.pxi
===================================================================
--- trunk/pysoy/src/bodies._bodies/Body.pxi 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/src/bodies._bodies/Body.pxi 2007-07-08 20:27:20 UTC (rev
427)
@@ -24,22 +24,38 @@
mass, and which joints and shapes may be provided to limit movement.
'''
- def __new__(self, object scene=None, *args, **keywords) :
+ def __new__(self, scene=None,
+ position=None, rotation=None, velocity=None,
+ mesh=None, shape=None,
+ *args, **keywords) :
self._quaternion[0] = 1.0
if scene == None :
self._bodyID = NULL
else :
self.scene = scene
+ if position :
+ self.position = position
+ if rotation :
+ self.rotation = rotation
+ if velocity :
+ self.velocity = velocity
+ if mesh :
+ self.mesh = mesh
+ if shape :
+ self.shape = shape
+
def __dealloc__(self) :
del(self.scene)
+
cdef void poke(self, vector) :
if self._bodyID :
ode.dBodyAddForce(self._bodyID, vector[0], vector[1], vector[2])
else :
raise UnboundLocalError('Body is not in a scene')
+
property scene :
'''Body's Scene
@@ -69,7 +85,6 @@
self._create()
self._scene._bodies.append(<void *>self)
self._scene._bodies.unlock()
-
def __del__(self) :
if self._isActive() :
self._scene._bodies.lock()
@@ -77,6 +92,7 @@
self._destroy()
self._scene._bodies.unlock()
+
property mass :
'''Body's mass
@@ -126,6 +142,7 @@
self._position[0] = value[0]
self._position[1] = value[1]
self._position[2] = value[2]
+
property rotation :
'''Body's Rotational Velocity
@@ -152,6 +169,7 @@
self._angularVel[1] = value[1]
self._angularVel[2] = value[2]
+
property velocity :
'''Body's Linear Velocity
@@ -177,6 +195,36 @@
self._linearVel[1] = value[1]
self._linearVel[2] = value[2]
+
+ property mesh :
+ '''Body's mesh
+
+ If an instance of soy.meshes.Mesh it will be rendered as this Body.
+ Defaults to None.
+ '''
+ def __get__(self) :
+ return self._mesh
+ def __set__(self, _mesh) :
+ if not (isinstance(_mesh, soy.meshes.Mesh) or self._mesh == None ) :
+ raise TypeError('must be an instance of soy.meshes.Mesh')
+ self._mesh = _mesh
+
+
+ property shape :
+ '''Body's shape, if it has one.
+
+ The shape used for collisions.
+ Defaults to None.
+ '''
+ def __get__(self) :
+ return self._shape
+ def __set__(self, value) :
+ if not isinstance(value, soy.shapes.Shape) :
+ raise TypeError('Requires a Shape')
+ # This call will make any needed changes to this object as well
+ (<soy.shapes.Shape> value).body = self
+
+
cdef void _create(self) :
self._bodyID = ode.dBodyCreate(self._scene._worldID)
ode.dBodySetData(self._bodyID, <void *>self)
@@ -188,6 +236,7 @@
ode.dBodySetAngularVel(self._bodyID, self._angularVel[0],
self._angularVel[1], self._angularVel[2])
+
cdef void _destroy(self) :
cdef ode.dReal *real
ode.dBodyCopyPosition(self._bodyID, self._position)
@@ -204,25 +253,39 @@
ode.dBodyDestroy(self._bodyID)
self._bodyID = NULL
- property shape :
- '''Body's shape, if it has one.
-
- The shape used for collisions.
- '''
- def __get__(self) :
- return self._shape
- def __set__(self, object value) :
- if not isinstance(value, soy.shapes.Shape) :
- raise TypeError('Requires a Shape')
- # This call will make any needed changes to this object as well
- (<soy.shapes.Shape> value).body = self
-
cdef int _isActive(self) :
if self._bodyID == NULL :
return 0
else :
return 1
+
cdef void _render(self) :
- return
+ if not self._mesh :
+ return
+ cdef ode.dReal *pos
+ cdef ode.dReal *rot
+ cdef gl.GLfloat mtx[16]
+ pos = <ode.dReal *> ode.dBodyGetPosition(self._bodyID)
+ rot = <ode.dReal *> ode.dBodyGetRotation(self._bodyID)
+ mtx[0] = rot[0]
+ mtx[1] = rot[4]
+ mtx[2] = rot[8]
+ mtx[3] = 0.0
+ mtx[4] = rot[1]
+ mtx[5] = rot[5]
+ mtx[6] = rot[9]
+ mtx[7] = 0.0
+ mtx[8] = rot[2]
+ mtx[9] = rot[6]
+ mtx[10] = rot[10]
+ mtx[11] = 0.0
+ mtx[12] = pos[0]
+ mtx[13] = pos[1]
+ mtx[14] = pos[2]
+ mtx[15] = 1.0
+ gl.glPushMatrix()
+ gl.glMultMatrixf(mtx)
+ (<soy.meshes.Mesh> self._mesh)._render()
+ gl.glPopMatrix()
Deleted: trunk/pysoy/src/bodies._bodies/Mesh.pxi
===================================================================
--- trunk/pysoy/src/bodies._bodies/Mesh.pxi 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/src/bodies._bodies/Mesh.pxi 2007-07-08 20:27:20 UTC (rev
427)
@@ -1,206 +0,0 @@
-# PySoy bodies.Mesh Class
-#
-# Copyright (C) 2006,2007 Team PySoy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see http://www.gnu.org/licenses
-#
-# $Id$
-
-cdef class Mesh(Body) :
- '''PySoy Mesh
-
- This is a body which renders a group of triangles called a "mesh".
- '''
- def __new__(self, scene=None, *args, **keywords) :
- self._faces = soy._datatypes.FaceList(self)
- self._verts = soy._datatypes.VertexList(self)
-
-
- def __repr__(self) :
- return '<Mesh with %d verticies, %d faces, and %d materials>' % (
- len(self._verts), len(self._faces), self._nmate)
-
-
- property faces :
- '''Mesh.faces
-
- This is a list-like object for manipulating the faces of a Mesh.
- '''
- def __get__(self) :
- return self._faces
-
-
- property verts :
- '''Mesh.verts
-
- This is a list-like object for manipulating the verticies of a Mesh.
- '''
- def __get__(self) :
- return self._verts
-
-
- property textures :
- '''Mesh.textures
-
- This is a list-like object for manipulating the textures of a Mesh.
- '''
- def __get__(self) :
- return soy._datatypes.TextureList(self)
-
-
- # Rendering Pipeline :
- #
- # We start with the "original" vertex array. This does not change within
- # _render, only from the Python side. When the Python side changes values
- # the self._uvert is given the range needing to be recalculated.
- #
- # The next step is applying morph targets. The product of this must be
- # saved because, often, morph will change infrequently. When no morphs are
- # in use the "original" is simply copied here and updated whenever needed.
- #
- # After morphs we need to do bone transformations. Bone transformations
- # from resting to current within the coordinate system of the Mesh's Body
- # is aquired and a comparison of transformation from the last frame (ie,
- # how much that bone has moved since last calculated) is made.
- #
- # Once all the bone transformations are calculated each vertex tests against
- # the bones that it's attached to. First step of this is to multiply it's
- # weight (0.0 - 1.0) against the amount of transformation and test to see if
- # it's greater than the culling value (if it's changed enough to recalc).
- # If so, calculate that vertex's transformation based on weights for each
- # bone it's attached to and then apply the product of this.
- #
- # These are placed, one by one, into the final array with the appropriate
- # VBO update array calculated. If VBO, the updated subarray range is sent,
- # and in both VA and VBO this is transformed to the body's location and
- # then rendered.
-
- cdef void _render(self) :
- cdef ode.dReal *pos
- cdef ode.dReal *rot
- cdef gl.GLfloat mtx[16]
- pos = <ode.dReal *> ode.dBodyGetPosition(self._bodyID)
- rot = <ode.dReal *> ode.dBodyGetRotation(self._bodyID)
- mtx[0] = rot[0]
- mtx[1] = rot[4]
- mtx[2] = rot[8]
- mtx[3] = 0.0
- mtx[4] = rot[1]
- mtx[5] = rot[5]
- mtx[6] = rot[9]
- mtx[7] = 0.0
- mtx[8] = rot[2]
- mtx[9] = rot[6]
- mtx[10] = rot[10]
- mtx[11] = 0.0
- mtx[12] = pos[0]
- mtx[13] = pos[1]
- mtx[14] = pos[2]
- mtx[15] = 1.0
- gl.glPushMatrix()
- gl.glMultMatrixf(mtx)
- if gl.GLEW_ARB_vertex_buffer_object :
- self._renderVBO()
- else :
- self._renderVA()
- gl.glPopMatrix()
-
-
- cdef void _renderVA(self) :
- cdef int i
- self._verts._renderArray()
- for i from 0 <= i < self._nmate :
- (<soy.materials.Material> self._mates[i].mat)._bind()
- self._faces._renderArray(self._mates[i].offset, self._mates[i].length)
- (<soy.materials.Material> self._mates[i].mat)._unbind()
-
-
- cdef void _renderVBO(self) :
- cdef int i
- if self._faces._arraySize == 0 :
- return
- if self._faces._buffer == 0 :
- self._createVBO()
- gl.glBindBufferARB (gl.GL_ELEMENT_ARRAY_BUFFER_ARB, self._faces._buffer)
- self._faces._sendUpdated()
- self._verts._renderBuffer()
- for i from 0 <= i < self._nmate :
- (<soy.materials.Material> self._mates[i].mat)._bind()
- self._faces._renderBuffer(self._mates[i].offset, self._mates[i].length)
- (<soy.materials.Material> self._mates[i].mat)._unbind()
-
-
- cdef void _createVBO(self) :
- self._faces._createBuffer()
- self._verts._createBuffer()
-
-
- cdef void *_alloc(self, int num, int* m, void* store, int size) :
- if num == 0 :
- m[0] = 0
- py.PyMem_Free(store)
- return NULL
- if m[0] == 0 :
- m[0] = num + 15
- return py.PyMem_Malloc(m[0] * size)
- if num > m[0] or num+120 < m[0] :
- m[0] = num + 15
- return py.PyMem_Realloc(store, m[0] * size)
- return store
-
-
- cdef void _allocMates(self, int num) :
- self._mates = <MatRange *> self._alloc(num, &self._mmate,
- self._mates, sizeof(MatRange))
-
-
-cdef class Pyramid(Mesh) :
- '''This is for testing only'''
- def __new__(self, object scene=None, object tex=None, *args, **keywords) :
- cdef object a, b, c, d, e
- self._allocMates(3)
- self._nmate = 3
- import soy.colors
- self.mat0 = soy.materials.Material(ambient=soy.colors.BlueViolet(),
- diffuse=soy.colors.Cyan())
- self.mat1 = soy.materials.Material(ambient=soy.colors.YellowGreen(),
- diffuse=soy.colors.GoldenRod())
- self.mat2 = soy.materials.Material(color=tex)
-
- self._mates[0].mat = <void *>self.mat0
- self._mates[1].mat = <void *>self.mat1
- self._mates[2].mat = <void *>self.mat2
- self._mates[0].offset = 0
- self._mates[0].length = 2
- self._mates[1].offset = 2
- self._mates[1].length = 2
- self._mates[2].offset = 4
- self._mates[2].length = 2
-
- a = soy.atoms.Vertex(self,position=( 0, 1, 0), texcoord=(0,0,0))
- b = soy.atoms.Vertex(self,position=(-1,-1, 1), texcoord=(0,0,0))
- c = soy.atoms.Vertex(self,position=( 1,-1, 1), texcoord=(0,1,0))
- d = soy.atoms.Vertex(self,position=( 1,-1,-1), texcoord=(1,1,0))
- e = soy.atoms.Vertex(self,position=(-1,-1,-1), texcoord=(1,0,0))
-
- soy.atoms.Face(self, verts=(a,b,c))
- soy.atoms.Face(self, verts=(a,d,e))
- soy.atoms.Face(self, verts=(a,c,d))
- soy.atoms.Face(self, verts=(a,e,b))
- soy.atoms.Face(self, verts=(d,c,b))
- soy.atoms.Face(self, verts=(e,d,b))
-
-
- def __dealloc__(self) :
- self._allocMates(0)
Modified: trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd
===================================================================
--- trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd 2007-07-08
20:15:07 UTC (rev 426)
+++ trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pxd 2007-07-08
20:27:20 UTC (rev 427)
@@ -22,32 +22,14 @@
cimport py
cimport stdio
cimport soy._core
-cimport soy._datatypes
cimport soy._internals
-cimport soy.materials
-cimport soy.textures
+cimport soy.meshes
cimport soy.shapes
-cdef struct Face :
- unsigned short a
- unsigned short b
- unsigned short c
-
-
-cdef struct Range :
- int offset
- int length
-
-
-cdef struct MatRange :
- void *mat
- int offset
- int length
-
-
cdef class Body :
cdef ode.dBodyID _bodyID
cdef soy._core.Scene _scene
+ cdef soy.meshes.Mesh _mesh
cdef soy.shapes.Shape _shape
# for loading/saving
cdef ode.dMass _mass
@@ -66,26 +48,3 @@
cdef class Camera (Body) :
cdef float _fovy
cdef void _project(self)
-
-
-cdef class Mesh (Body) :
- cdef soy._datatypes.FaceList _faces
- cdef soy._datatypes.VertexList _verts
- #
- # Texture Data
- cdef unsigned int _nmate # number of
- cdef int _mmate # malloced
- cdef MatRange *_mates # material ranges
-
- #
- # Mesh Functions
- cdef void _renderVA (self)
- cdef void _renderVBO (self)
- cdef void _createVBO (self)
- cdef void *_alloc (self, int, int*, void*, int)
- cdef void _allocMates (self, int)
-
-cdef class Pyramid (Mesh) :
- cdef soy.materials.Material mat0
- cdef soy.materials.Material mat1
- cdef soy.materials.Material mat2
Modified: trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pyx
===================================================================
--- trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pyx 2007-07-08
20:15:07 UTC (rev 426)
+++ trunk/pysoy/src/bodies._bodies/soy.bodies._bodies.pyx 2007-07-08
20:27:20 UTC (rev 427)
@@ -26,4 +26,3 @@
include "Body.pxi"
include "Camera.pxi"
-include "Mesh.pxi"
Modified: trunk/pysoy/src/meshes/Mesh.pxi
===================================================================
--- trunk/pysoy/src/meshes/Mesh.pxi 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/src/meshes/Mesh.pxi 2007-07-08 20:27:20 UTC (rev 427)
@@ -17,7 +17,7 @@
#
# $Id$
-cdef class Mesh(Body) :
+cdef class Mesh :
'''PySoy Mesh
This is a collection of triangles which may share verticies.
Modified: trunk/pysoy/src/meshes/soy.meshes.pxd
===================================================================
--- trunk/pysoy/src/meshes/soy.meshes.pxd 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/src/meshes/soy.meshes.pxd 2007-07-08 20:27:20 UTC (rev
427)
@@ -32,7 +32,7 @@
int length
-cdef class Mesh (Body) :
+cdef class Mesh :
cdef soy._datatypes.FaceList _faces
cdef soy._datatypes.VertexList _verts
#
Modified: trunk/pysoy/src/widgets/soy.widgets.pxd
===================================================================
--- trunk/pysoy/src/widgets/soy.widgets.pxd 2007-07-08 20:15:07 UTC (rev
426)
+++ trunk/pysoy/src/widgets/soy.widgets.pxd 2007-07-08 20:27:20 UTC (rev
427)
@@ -20,11 +20,11 @@
cimport gl
cimport stdio
cimport soy._core
+cimport soy._datatypes
+cimport soy._internals
cimport soy.bodies._bodies
cimport soy.colors
cimport soy.textures
-cimport soy._datatypes
-cimport soy._internals
cdef class Widget :
cdef soy._core.Window _window
@@ -54,7 +54,7 @@
cdef class Canvas (Widget) :
cdef object _texture
cdef soy._datatypes.Vert _verts[4]
- cdef soy.bodies._bodies.Face _faces[2]
+ cdef soy._datatypes.Face _faces[2]
cdef class Projector (Widget) :
Modified: trunk/pysoy/tests/lit_pyramid.py
===================================================================
--- trunk/pysoy/tests/lit_pyramid.py 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/tests/lit_pyramid.py 2007-07-08 20:27:20 UTC (rev 427)
@@ -6,6 +6,7 @@
img = Image.open('lava.png')
tex = soy.textures.Image(img)
+pym = soy.meshes.Pyramid(luma)
scr = soy.Screen()
win = soy.Window(scr, 'Lit Pyramid')
@@ -13,7 +14,7 @@
cam = soy.bodies.Camera(sce)
cam.position = (0.0, 0.0, 5.0)
pro = soy.widgets.Projector(win, camera=cam)
-pyr = soy.bodies.Pyramid(sce, tex)
+pyr = soy.bodies.Body(sce, mesh=pym)
pyr.rotation = (1.0, 0.0, 0.0)
lig = soy.bodies.lights.Light(sce)
lig.position = (-1.0,1.0,2.0)
Modified: trunk/pysoy/tests/tex_pyramid.py
===================================================================
--- trunk/pysoy/tests/tex_pyramid.py 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/tests/tex_pyramid.py 2007-07-08 20:27:20 UTC (rev 427)
@@ -9,6 +9,7 @@
img = Image.open('la.png')
luma = soy.textures.Image(img)
+pym = soy.meshes.Pyramid(luma)
scr = soy.Screen()
win = soy.Window(scr, 'Textured Pyramid')
@@ -19,7 +20,7 @@
ca1 = soy.widgets.Canvas(win, aspect=0.0, texture=lava)
pro = soy.widgets.Projector(win, camera=cam)
-pyr = soy.bodies.Pyramid(sce, luma)
+pyr = soy.bodies.Body(sce, mesh=pym)
pyr.rotation = (1.0, 1.0, 0.0)
if __name__ == '__main__' :
Modified: trunk/pysoy/tests/vid_pyramid.py
===================================================================
--- trunk/pysoy/tests/vid_pyramid.py 2007-07-08 20:15:07 UTC (rev 426)
+++ trunk/pysoy/tests/vid_pyramid.py 2007-07-08 20:27:20 UTC (rev 427)
@@ -9,6 +9,7 @@
ogg = soy.transports.File('changeworld.ogg')
vido = ogg['video']
+pym = soy.meshes.Pyramid(vido)
scr = soy.Screen()
win = soy.Window(scr, 'Textured Pyramid')
@@ -19,7 +20,7 @@
ca1 = soy.widgets.Canvas(win, margin=10, aspect=0.0, texture=lava)
pro = soy.widgets.Projector(win, camera=cam)
-pyr = soy.bodies.Pyramid(sce, vido)
+pyr = soy.bodies.Body(sce, mesh=pym)
pyr.rotation = (1.0, 1.0, 0.0)
if __name__ == '__main__' :
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn