Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textured triangle surface changes shades based on camera angle despite lighting set to false #205

Open
owenlamont opened this issue Nov 18, 2018 · 0 comments

Comments

@owenlamont
Copy link

I was rendering a textured triangle surface using the following code:

import ipyvolume as ipv
import numpy as np
from PIL import Image

background = Image.open("Carnarvon.png")
fig = ipv.figure(lighting=False)
x = np.array([0,  1.0,  1.0,  0])
z = np.array([0,  0, 1.0, 1.0])
y = np.array([0., 0, 0., 0])
u = np.array([0,  1.,  1.,  0])
v = np.array([0,  0, -1., -1.])
triangles = [(0, 1, 2), (0, 2, 3)]
m = ipv.plot_trisurf(x, y, z, triangles=triangles, u=u, v=v, texture=background)
ipv.show()

The triangle surface gets closer to the original image colour the more perpendicular the camera is to the surface, and blacker the more the camera is parallel to the surface - but I expected the colour of the triangle surface to stay consistent, and true to the original image colors, regardless of the camera angle. See below:

screen shot 2018-11-18 at 8 52 39 pm

screen shot 2018-11-18 at 8 53 22 pm

screen shot 2018-11-18 at 9 13 54 pm

I'm used the Anaconda installs on MacOS with the following versions:

  • ipyvolume 0.5.1
  • pythreejs 2.0.2
  • Python 3.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant