enthought / enthought/mayavi

Setting the camera view does not work as expected

Open
#1,164 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

For the following snippet the camera view does not show a consistent behavior:

```
import numpy as np
from mayavi.mlab import quiver3d
from mayavi import mlab

x, y, z = np.mgrid[-2:3, -2:3, -2:3]
r = np.sqrt(x ** 2 + y ** 2 + z ** 4)
u = y * np.sin(r) / (r + 0.001)
v = -x * np.sin(r) / (r + 0.001)
w = np.zeros_like(z)
quiver3d(x, y, z, u, v, w, line_width=3, scale_factor=1)

mlab.view(distance=50)
mlab.view(azimuth=45)

mlab.show()
```

```
mlab.view(distance=50)
mlab.view(azimuth=45)

```
results in

![grafik](https://user-images.githubusercontent.com/10460113/182636051-6a32f121-ef92-473c-8db9-20cd724f63e1.png)

while flipping the order

```
mlab.view(azimuth=45)
mlab.view(distance=50)
```

and

`mlab.view(azimuth=45, distance=50)`

result in

![grafik](https://user-images.githubusercontent.com/10460113/182636160-a69930cd-addf-4977-bca8-c81f49461d5a.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.