'How can I get rid of zig zag artifact on sphere surface in vispy?
everyone
I'm working on the 3D visualization of planets in the solar system. As I am going to apply texture, I have manually computed the texture coordinates(texcoords) and I get the zig-zag artefact as appears in the image.
I believe that my computation might have something wrong. I have attached the texcoords computation below
# Compute Texture Coordinates
def get_texcoords(vertices):
texcoords = []
for v in vertices:
#thresholding
for i in range(3):
if np.abs(v[i]) > 1e-6:
v[i] = v[i]
elif np.abs(v[i]) < 1e-6:
v[i] = 0.0
# Compute position in uv-space
radius = np.sqrt(v[0]**2 + v[1]**2 + v[2]**2)
latitude = np.arcsin(v[2]/radius)
longitude = np.arctan2(v[1],v[0])
# Convert to texture coordinates
u = round(0.5 + longitude/(2*np.pi),5)
v = round(0.5 + latitude/np.pi,5)
texcoords.append([u,v])
return np.array(texcoords)
Is there any way to get those artefacts away, or does it have a smarter way to obtain texture coordinate in vispy.
Thank you for your help and suggestion.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
