Class RenderMesh

java.lang.Object
boofcv.visualize.RenderMesh
All Implemented Interfaces:
VerbosePrint

public class RenderMesh extends Object implements VerbosePrint
Simple algorithm that renders a 3D mesh and computes a depth image. This rendering engine is fairly basic and makes the following assumptions: each shape has a single color and all colors are opaque. What's configurable:
  • defaultColorRgba Specifies what color the background is.
  • surfaceColor Function which returns the color of a shape. The shape's index is passed.
  • intrinsics Camera intrinsics. This must be set before use.
  • worldToView Transform from work to the current view.
  • Field Details

    • defaultColorRgba

      public int defaultColorRgba
      What color background pixels are set to by default in RGBA. Default value is white
    • surfaceColor

      public RenderMesh.SurfaceColor surfaceColor
      Used to change what color a surface is. By default, it's red.
    • depthImage

      public final GrayF32 depthImage
      Rendered depth image. Values with no depth information are set to NaN.
    • rgbImage

      public final InterleavedU8 rgbImage
      Rendered color image. Pixels are in RGBA format.
    • intrinsics

      public final CameraPinhole intrinsics
      Pinhole camera model needed to go from depth image to 3D point
    • worldToView

      public final Se3_F64 worldToView
      Transform from world (what the mesh is in) to the camera view
  • Constructor Details

    • RenderMesh

      public RenderMesh()
  • Method Details

    • render

      public void render(VertexMesh mesh)
      Renders the mesh onto an image. Produces an RGB image and depth image. Must have configured intrinsics already and set worldToView.
      Parameters:
      mesh - The mesh that's going to be rendered.
    • setVerbose

      public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration)
      Specified by:
      setVerbose in interface VerbosePrint