@alexalex You cannot get the plot of a 3d object in your preferred system of coordinates (i.e. OpenGL system of coords) just by changing the viewer position. You have to transform your data x, y,z, expressed in the world (Plotly) coordinate system, to coordinates in your system, and change the axes labels (titles).
First I represent a cone of equation z=1.5\sqrt{x^2+y^2} in the Plotly system of coords. Then I define the linear transformation, represented by a matrix, from the plotly syst to your syst, and apply this transformation to the dstacked data [x,y,z], such that in the new system the cone vertex is at origin and zaxis is its symmetry axis, exactly as in the case of Plotly coordinate system.
import plotly.graph_objects as go
import numpy as np
from numpy import pi, sin, cos
u = np.linspace(0,0.75, 20)
v = np.linspace(0, 2*pi, 100)
u, v = np.meshgrid(u,v)
x = u*cos(v)
y = u*sin(v)
z = 1.5*u
fig = go.Figure(go.Surface(x=x, y=y, z=z))
fig.update_layout(scene_camera_eye=dict(x=1.5, y=1.5, z=1), font_size=10)
Transformations:
def transf():
return np.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]])
def transf_data(x, y, z):
X, Y, Z = np.einsum('ji, mni -> jmn', transf().T, np.dstack([x, y, z]))
return X, Y, Z
X, Y, Z = transf_data(x,y,z)
fig.update_traces(x=X, y=Y, z=Z)
fig.update_scenes(xaxis_title="z", yaxis_title="x", zaxis_title="y")
Depending on your data, you can now change the position of the viewer to get the 3d object displayed such that to reveal some property.