コード例 #1
0
ファイル: camera.py プロジェクト: tarpeyd12/pylon
	def mouserot(self):
		if pylon.mouse_ispressed():
			if pylon.mouse_getbutton() == 0:
				difx = ( pylon.mouse_pos_sx() - pylon.mouse_pos_x() ) * -1
				dify = ( pylon.mouse_pos_sy() - pylon.mouse_pos_y() ) * -1
				self.anglex = ( ( float(dify) / float(pylon.window_height()) ) * 180.0 ) + self.panglex
				self.angley = ( ( float(difx) / float(pylon.window_width())  ) * 360.0 ) + self.pangley
				self.setforcenter(self.center,self.radus,self.anglex-90+180,360-(self.angley+180))
		else:
			self.panglex = self.anglex
			self.pangley = self.angley
コード例 #2
0
ファイル: init.py プロジェクト: tarpeyd12/pylon
# setup the camera
cam = Camera( Position( 0, 0, 0 ), Position( 0, 0, 0 ) )

# declare the way in which the simple object movement example moves objects
movestatetype = 0

# a randomly placed variable
going = True

# random number from -1 to 1
def rnd_n1p1():
	return (random.random() * 2) - 1

# create objects for the mouse cursor and dragbox
Mouse = Quad(0,0,pylon.mouse_pos_x(),pylon.mouse_pos_y(),'{[Data/images/mouse_pointer.png]}')
ClickLine = Quad(0,0,pylon.mouse_pos_x(),pylon.mouse_pos_y(),'{[Data/images/red_square.bmp]}')
ClickLine.setproperties( pylon.triangle_transparent )

# declare a simulation
sim2 = Simulation("simulation2",True)

# create collidable simulation 'sim'
sim = Simulation("sim",True)

zeropos = makepos(0,0,0)

possibleImages = [ '{[Data/images/earth.bmp]}', '{[Data/images/Glass.bmp]}', '{[Data/images/lava8.bmp]}', '{[Data/images/mandel_2.png]}', '{[Data/images/pogel_runner_galax_color_1.png]}', '{[Data/images/default_2.bmp]}', '{[Data/images/mouse_pointer.png]}' ]

tvn = pylon.triangle_vertex_normals
tlt = pylon.triangle_lit