You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a coordinate frame using o3d.create_mesh_coordinate_frame(). If I'd display it in open3d (http://www.open3d.org/), it would look like this:
However, their Jupyter viewer does not work, which is why for Jupyter I'm visualizing using k3d. The conversion to a k3d.mesh object is straightforward for vertices and indices. However, I can't understand how coloring work. Can't I just make faces get the average of the triangle's colors? Seems like this is the way it's implemented in open3d... But perhaps I am missing something?
Thanks!
The text was updated successfully, but these errors were encountered:
To add face colors, you need to create a face attribute array, Python code suitable for a MeshModifierScript would be e.g.:
#pythonimportk3d# Shallow-copy everythingcontext.output.copy(context.input)
# Get a modifiable version of the first polyhedronoutput_poly=k3d.polyhedron.validate(context.output, context.output.primitives()[0])
# Create a per-face color arrayCs=output_poly.face_attributes().create("Cs", "k3d::color")
# Loop over the number of faces, adding a color for eachnb_faces=len(output_poly.face_first_loops())
foriinrange(nb_faces):
Cs.append(k3d.color(1,0,float(i)/nb_faces))
Here is a document with this script applied to a grid and the OpenGLColorFacePainter set up: coloredfaces.k3d.zip
I'm creating a coordinate frame using
o3d.create_mesh_coordinate_frame()
. If I'd display it inopen3d
(http://www.open3d.org/), it would look like this:However, their Jupyter viewer does not work, which is why for Jupyter I'm visualizing using
k3d
. The conversion to ak3d.mesh
object is straightforward for vertices and indices. However, I can't understand how coloring work. Can't I just make faces get the average of the triangle's colors? Seems like this is the way it's implemented inopen3d
... But perhaps I am missing something?Thanks!
The text was updated successfully, but these errors were encountered: