Exemplo n.º 1
0
 def load(self, tex) :
     #load shape
     self.mod = loader.loadModel("models/planet_sphere")
     
     #load texture
     mod_tex = loader.loadTexture("models/"+tex)
     self.mod.setTexture(mod_tex, 1)
     
     #Camera position shouldn't make actors disappear
     self.mod.node().setBounds(panda3d.core.OmniBoundingVolume())
     self.mod.node().setFinal(True)
     
     #Create always visible marker
     self.marker = graphics.makeArc()
     self.marker.setScale(MARKERSCALE)
     self.marker.setTransparency(panda3d.core.TransparencyAttrib.MAlpha)
     self.marker.reparentTo(aspect2d)
     self.has_marker = True
     # not affected by sunlight
     self.marker.hide(panda3d.core.BitMask32.bit(0))
     # not visible by default
     self.hideMarker()
 
     #marker of orientation
     self.axis = graphics.makeCross()
     self.axis.setScale(AXSCALE * self.radius)
     self.axis.setTransparency(panda3d.core.TransparencyAttrib.MAlpha)
     self.axis.reparentTo(self.mod)
     self.has_axis = True
     # not affected by sunlight
     self.axis.hide(panda3d.core.BitMask32.bit(0))
     # not visible by default
     self.hideAxis()
Exemplo n.º 2
0
 def loadOrbit(self) :
     #Draw orbits
     self.orbit_line = graphics.makeArc(360, ORBITRESOLUTION)
     self.orbit_line.setTransparency(panda3d.core.TransparencyAttrib.MAlpha)
     self.orbit_line.setHpr( 0, 90,0)
     #Camera position shouldn't make these actors disappear
     self.orbit_line.node().setBounds(panda3d.core.OmniBoundingVolume())
     self.orbit_line.node().setFinal(True)
     # orbits are not affected by sunlight
     self.orbit_line.hide(panda3d.core.BitMask32.bit(0))
     self.orbit_line.reparentTo(self.root)
     self.has_orbit = True
     self.hideOrbit()