Danke dir deets, wir kommen der Sache näher.
Der Text dort lautet:
def get_proj(self):
"""
Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane
azim stores the azimuth angle in the (x, y) plane
dist is the distance of the eye viewing point from the object point.
"""
relev, razim = np.pi * self.elev/180, np.pi * self.azim/180
xmin, xmax = self.get_xlim3d()
ymin, ymax = self.get_ylim3d()
zmin, zmax = self.get_zlim3d()
# transform to uniform world coordinates 0-1, 0-1, 0-1
worldM = proj3d.world_transformation(xmin, xmax, ymin, ymax, zmin, zmax)
# look into the middle of the new coordinates
R = np.array([0.5, 0.5, 0.5])
xp = R[0] + np.cos(razim) * np.cos(relev) * self.dist
yp = R[1] + np.sin(razim) * np.cos(relev) * self.dist
zp = R[2] + np.sin(relev) * self.dist
E = np.array((xp, yp, zp))
self.eye = E
self.vvec = R - E
self.vvec = self.vvec / np.linalg.norm(self.vvec)
if abs(relev) > np.pi/2:
# upside down
V = np.array((0, 0, -1))
else:
V = np.array((0, 0, 1))
zfront, zback = -self.dist, self.dist
viewM = proj3d.view_transformation(E, R, V)
projM = self._projection(zfront, zback)
M0 = np.dot(viewM, worldM)
M = np.dot(projM, M0)
return M
Aber daraus werde ich nicht schlau!
Zumal der Text Ungenauigkeiten und Fehler enthält hinsichtlich Reihenfolge und Ebene der Winkel, es müsste heissen:
(1.) azim stores the azimuth angle in the (x, y) plane
(2.) elev stores the elevation angle in the (y, z) plane (was soll denn sonst eine y-plane sein???)
(3.) dist is the distance of the eye viewing point from the object point.
Das verunsichert mich natürlich noch mehr. Dazu ist die Distanz immer = 10, also kann es nicht die Distanz in Datacoordinates sein...
Ich denke man sieht daran, und an den wenigen Beiträgen zum Thema im Web, dass das Problem nur wenigen Programmierern begegnet.
Eigentlich sollte der eigene Viewpoint bei Gameengines ständig gebraucht werden, aber in Matplotlib?
Also bitte helft mir etwas weiter, ich brauche letztlich die x, y, z- Koordinaten meines Blickpunktes in Datacoordinates, der Umweg über azim & elev ist ja nicht unbedingt nötig.
Dann kann ich die Lautstärken der Planetensounds in Abhängigkeit von meiner Position im Raum berechnen
Beste Grüße, Norbert