Beispiel #1
0
    def __init__(self, filename, compile=True, buffer=None):
        VisibleNode.__init__(self)
        Translator.__init__(self)

        self.rotX = 0.0
        self.rotY = 0.0
        self.rotZ = 0.0

        self.scale = 1.0

        if Model.dlcache.has_key(filename):
            self._displayList = Model.dlcache[filename]
            bb = Model.bbcache[filename]
        else:
            if buffer is None:
                self._dom = dom3ds.read_3ds_file(filename)
            else:
                self._dom = dom3ds.read_3ds_mem(buffer)
            self._model = glmodel.GLModel(self._dom, self._loadTexture)
            bb = self._model.bounding_box()
            Model.bbcache[filename] = bb
            if compile:
                self._displayList = self._model.create_dl()
                Model.dlcache[filename] = self._displayList
            else:
                self._displayList = None
        self._center = (bb[0] + bb[1]) / 2
        self._modelScale = 1.0 / max(abs(bb[0] - bb[1]))
Beispiel #2
0
 def __init__(self):
     VisibleNode.__init__(self)
     self.startX = self.startY = self.startZ = 0.0
     self.endX = self.endY = self.endZ = 0.0
     self.color = (1.0, 1.0, 1.0)
     self.opacity = 1.0
     self.lineWidth = 1.0
Beispiel #3
0
 def __init__(self):
     VisibleNode.__init__(self)
     Translator.__init__(self)
     self.color = (1.0, 1.0, 1.0)
     self.opacity = 1.0
     self.size = None