wie man die Maus abfragt (1).py
wie man die Maus abfragt (1).py — Python Source, 1 KB
Dateiinhalt
# -*- coding: utf-8 -*- # Kameraverhältnisse in 3D-Szenarien # 2010-04-18 from visual import * #scene.autoscale = False gelbKugel = sphere(pos=(-2,0,0), color=color.yellow, opacity=0.5) gruenBox = box(pos=(2,0,0), color=color.green, opacity=0.5) cameraVektor = label(pos=scene.center, yoffset=50) #cameraPfeil = arrow(pos=scene.center, color=color.red, opacity=0.25) while True: rate(50) cameraVektor.text = "scene.mouse.camera:\n"\ +str(round(scene.mouse.camera.x,2)).zfill(5)+" "\ +str(round(scene.mouse.camera.y,2)).zfill(5)+" "\ +str(round(scene.mouse.camera.z,2)).zfill(5)+"\n"\ +"scene.forward:\n"\ +str(round(scene.forward.x,2)).zfill(5)+" "\ +str(round(scene.forward.y,2)).zfill(5)+" "\ +str(round(scene.forward.z,2)).zfill(5) #cameraPfeil.axis = scene.mouse.camera