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

Sphere texturing #257

Closed
harkness526 opened this issue Jun 7, 2019 · 3 comments
Closed

Sphere texturing #257

harkness526 opened this issue Jun 7, 2019 · 3 comments

Comments

@harkness526
Copy link

harkness526 commented Jun 7, 2019

I'm trying to plot mesh with Earth texture, but as a result, I got a shphere with a strange color. I suppose that problem with u and v, but I don't know how to fix it.
image

import PIL.Image
import numpy as np
import ipyvolume as ipv
image = PIL.Image.open('2k_earth_daymap.jpg')
R = 12742
u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)

x = R * np.outer(np.cos(u), np.sin(v))
y = R * np.outer(np.sin(u), np.sin(v))
z = R * np.outer(np.ones(np.size(u)), np.cos(v))

# u = np.array([x/5 +np.sin(k/8*np.pi)*4. for k in range(8)])
# v = np.array([-y/5*(1-k/7.) + z*(k/7.) for k in range(8)])
ipv.figure()
ipv.plot_mesh(x, z, y,u=y, v=x,wireframe=False,texture = image)  #texture = image
# earth.texture = PIL.Image.open('2k_earth_daymap.jpg')
ipv.show() 
@grburgess
Copy link

Is there any progress on this? I'm actually have the same issue.

@grburgess
Copy link

@maartenbreddels
Copy link
Collaborator

Thanks for the report! I think #302 is a good example for this, if not, please reopen.

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

3 participants