コード例 #1
0
if device:
	device.setWindowCaption('Hello World! - Irrlicht Engine Demo')
	device.setResizable(True)
	driver = device.getVideoDriver()
	scene_manager = device.getSceneManager()
	guienv = device.getGUIEnvironment()
	guienv.addStaticText('Hello World! This is the Irrlicht Software renderer!', pyirrlicht.recti(10,10,260,22), True)
	i_animated_mesh = scene_manager.getMesh('media//sydney.md2')
	if i_animated_mesh:
		node = scene_manager.addAnimatedMeshSceneNode2(i_animated_mesh)
		if node:
			node.setMaterialFlag(pyirrlicht.EMF_LIGHTING, False)
			node.setMD2Animation(pyirrlicht.EMAT_STAND)
			node.setMaterialTexture(0, driver.getTexture('media//sydney.bmp'))
		position = pyirrlicht.vector3df(0.0, 30.0, -40.0)
		lookat = pyirrlicht.vector3df(0.0, 5.0, 0.0)
		scene_manager.addCameraSceneNode(node, position, lookat)
		scolor = pyirrlicht.SColor(255,100,101,140)
		while device.run():
			if device.isWindowActive():
				if driver.beginScene(True, True, scolor):
					scene_manager.drawAll()
					guienv.drawAll()
					driver.endScene()
				#~ device.sleep(10)
			else:
				device.yield_self()
	else:
		print('ERROR getMesh')
	device.drop()
コード例 #2
0
 #~ device.setWindowCaption(window_caption)
 device.setResizable(True)
 scene_manager = device.getSceneManager()
 if pyirrlicht.IRRLICHT_VERSION < 180:
     device.getFileSystem().addZipFileArchive('media//map-20kdm2.pk3')
 else:
     device.getFileSystem().addFileArchive("media//map-20kdm2.pk3")
 i_animated_mesh = scene_manager.getMesh('20kdm2.bsp')
 if i_animated_mesh:
     i_mesh = i_animated_mesh.getMesh(0)
     if i_mesh:
         i_meshscene_node = scene_manager.addOctTreeSceneNode(
             i_mesh, 0, -1, 1024)
         if i_meshscene_node:
             i_meshscene_node.setPosition(
                 pyirrlicht.vector3df(-1300.0, -144.0, -1249.0))
         else:
             print('ERROR result method addOctTreeSceneNode2, SceneManager')
     else:
         print('ERROR result method getMesh, IAnimatedMesh')
     scene_manager.addCameraSceneNodeFPS()
     device.getCursorControl().setVisible(False)
     #~ guienv = device.getGUIEnvironment()
     driver = device.getVideoDriver()
     scolor = pyirrlicht.SColor(255, 200, 200, 200)
     lastFPS = -1
     while device.run():
         if device.isWindowActive():
             if driver.beginScene(True, True, scolor):
                 scene_manager.drawAll()
                 # guienv.drawAll()
コード例 #3
0
 device.setWindowCaption('Hello World! - Irrlicht Engine Demo')
 device.setResizable(True)
 driver = device.getVideoDriver()
 scene_manager = device.getSceneManager()
 guienv = device.getGUIEnvironment()
 guienv.addStaticText(
     'Hello World! This is the Irrlicht Software renderer!',
     pyirrlicht.recti(10, 10, 260, 22), True)
 i_animated_mesh = scene_manager.getMesh('media//sydney.md2')
 if i_animated_mesh:
     node = scene_manager.addAnimatedMeshSceneNode2(i_animated_mesh)
     if node:
         node.setMaterialFlag(pyirrlicht.EMF_LIGHTING, False)
         node.setMD2Animation(pyirrlicht.EMAT_STAND)
         node.setMaterialTexture(0, driver.getTexture('media//sydney.bmp'))
     position = pyirrlicht.vector3df(0.0, 30.0, -40.0)
     lookat = pyirrlicht.vector3df(0.0, 5.0, 0.0)
     scene_manager.addCameraSceneNode(node, position, lookat)
     scolor = pyirrlicht.SColor(255, 100, 101, 140)
     while device.run():
         if device.isWindowActive():
             if driver.beginScene(True, True, scolor):
                 scene_manager.drawAll()
                 guienv.drawAll()
                 driver.endScene()
             #~ device.sleep(10)
         else:
             device.yield_self()
 else:
     print('ERROR getMesh')
 device.drop()
コード例 #4
0
ファイル: Quake3Map.py プロジェクト: kenygia/pyirrlicht
if device:
	window_caption = 'Quake 3 Map! - Irrlicht Engine Demo'
	#~ device.setWindowCaption(window_caption)
	device.setResizable(True)
	scene_manager = device.getSceneManager()
	if pyirrlicht.IRRLICHT_VERSION < 180:
		device.getFileSystem().addZipFileArchive('media//map-20kdm2.pk3')
	else:
		device.getFileSystem().addFileArchive("media//map-20kdm2.pk3")
	i_animated_mesh = scene_manager.getMesh('20kdm2.bsp')
	if i_animated_mesh:
		i_mesh = i_animated_mesh.getMesh(0)
		if i_mesh:
			i_meshscene_node = scene_manager.addOctTreeSceneNode(i_mesh, 0, -1, 1024)
			if i_meshscene_node:
				i_meshscene_node.setPosition(pyirrlicht.vector3df(-1300.0, -144.0, -1249.0))
			else:
				print ('ERROR result method addOctTreeSceneNode2, SceneManager')
		else:
			print ('ERROR result method getMesh, IAnimatedMesh')
		scene_manager.addCameraSceneNodeFPS()
		device.getCursorControl().setVisible(False)
		#~ guienv = device.getGUIEnvironment()
		driver = device.getVideoDriver()
		scolor = pyirrlicht.SColor(255, 200, 200, 200)
		lastFPS = -1
		while device.run():
			if device.isWindowActive():
				if driver.beginScene(True, True, scolor):
					scene_manager.drawAll()
					# guienv.drawAll()