enthought / enthought/mayavi

Backface culling using X3D backend in Jupyter

Open
#485 4 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

In Jupyter I use

from __future__ import division, print_function
from mayavi import mlab
import numpy as np

mlab.init_notebook()

fig = mlab.figure(bgcolor=(1.0, 1.0, 1.0))
phi, theta = np.mgrid[0:np.pi:51j, 0:2*np.pi:51j]
x = np.sin(phi) * np.cos(theta)
y = np.sin(phi) * np.sin(theta)
z = np.cos(phi)
sphere = mlab.mesh(x, y, z, colormap="summer", opacity=0.6)
sphere.actor.property.backface_culling = True
fig

to obtain

![screenshot1](https://cloud.githubusercontent.com/assets/1097787/22680272/03a64200-ecd5-11e6-803b-c08cde49ad11.png)

In a regular Python script I use

from __future__ import division, print_function
from mayavi import mlab
import numpy as np


fig = mlab.figure(bgcolor=(1.0, 1.0, 1.0))
phi, theta = np.mgrid[0:np.pi:51j, 0:2*np.pi:51j]
x = np.sin(phi) * np.cos(theta)
y = np.sin(phi) * np.sin(theta)
z = np.cos(phi)
sphere = mlab.mesh(x, y, z, colormap="summer", opacity=0.6)
sphere.actor.property.backface_culling = True
mlab.show()

to obtain

![screenshot2](https://cloud.githubusercontent.com/assets/1097787/22680275/0bf4ce54-ecd5-11e6-9450-a6b9c785c969.png)

Is there a way to make the backface-culling to work in the Jupyter Notebook (X3D)??

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.