<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://boofcv.org/index.php?action=history&amp;feed=atom&amp;title=Example_View_Point_Cloud</id>
	<title>Example View Point Cloud - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://boofcv.org/index.php?action=history&amp;feed=atom&amp;title=Example_View_Point_Cloud"/>
	<link rel="alternate" type="text/html" href="https://boofcv.org/index.php?title=Example_View_Point_Cloud&amp;action=history"/>
	<updated>2026-06-22T10:41:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://boofcv.org/index.php?title=Example_View_Point_Cloud&amp;diff=2977&amp;oldid=prev</id>
		<title>Peter: Created page with &quot;Programmically creating a 3D point cloud viewer using the built in tools.  &#039;&#039;&#039;Example Code:&#039;&#039;&#039; * [https://github.com/lessthanoptimal/BoofCV/blob/v0.38/examples/src/main/java/b...&quot;</title>
		<link rel="alternate" type="text/html" href="https://boofcv.org/index.php?title=Example_View_Point_Cloud&amp;diff=2977&amp;oldid=prev"/>
		<updated>2021-07-12T22:08:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Programmically creating a 3D point cloud viewer using the built in tools.  &amp;#039;&amp;#039;&amp;#039;Example Code:&amp;#039;&amp;#039;&amp;#039; * [https://github.com/lessthanoptimal/BoofCV/blob/v0.38/examples/src/main/java/b...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Programmically creating a 3D point cloud viewer using the built in tools.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example Code:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [https://github.com/lessthanoptimal/BoofCV/blob/v0.38/examples/src/main/java/boofcv/examples/pointclouds/ExampleViewPointCloud.java ExampleViewPointCloud.java]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Concepts:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* 3D Point Cloud&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Related Examples:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[Example_Load_and_Save_Point_Clouds| Loading and Saving a Point Cloud]]&lt;br /&gt;
&lt;br /&gt;
= Example Code =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Shows you how to open a point cloud file and display it in a simple window.&lt;br /&gt;
 *&lt;br /&gt;
 * @author Peter Abeles&lt;br /&gt;
 */&lt;br /&gt;
public class ExampleViewPointCloud {&lt;br /&gt;
	public static void main( String[] args ) throws IOException {&lt;br /&gt;
		String filePath = UtilIO.pathExample(&amp;quot;mvs/stone_sign.ply&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Load the PLY file&lt;br /&gt;
		var cloud = new DogArray&amp;lt;&amp;gt;(Point3dRgbI_F32::new);&lt;br /&gt;
		PointCloudIO.load(PointCloudIO.Format.PLY, new FileInputStream(filePath), PointCloudWriter.wrapF32RGB(cloud));&lt;br /&gt;
&lt;br /&gt;
		System.out.println(&amp;quot;Total Points &amp;quot; + cloud.size);&lt;br /&gt;
&lt;br /&gt;
		// Create the 3D viewer as a Swing panel that will have some minimal controls for adjusting the clouds&lt;br /&gt;
		// appearance. Since a software render is used it will get a bit sluggish (on my computer)&lt;br /&gt;
		// around 1,000,000 points&lt;br /&gt;
		PointCloudViewerPanel viewerPanel = new PointCloudViewerPanel();&lt;br /&gt;
		viewerPanel.setPreferredSize(new Dimension(800, 600));&lt;br /&gt;
&lt;br /&gt;
		PointCloudViewer viewer = viewerPanel.getViewer();&lt;br /&gt;
		// Change the camera&amp;#039;s Field-of-View&lt;br /&gt;
		viewer.setCameraHFov(UtilAngle.radian(60));&lt;br /&gt;
		// So many formats to store a 3D point and color that a functional API is used here&lt;br /&gt;
		viewer.addCloud(&lt;br /&gt;
				( idx, p ) -&amp;gt; ConvertFloatType.convert(cloud.get(idx), p),&lt;br /&gt;
				( idx ) -&amp;gt; cloud.get(idx).rgb, cloud.size);&lt;br /&gt;
&lt;br /&gt;
		// There are a ton of options for the viewer, but we will let the GUI handle most of them&lt;br /&gt;
		// Alternatively, you could use VisualizeData.createPointCloudViewer(). No controls are&lt;br /&gt;
		// provided if you use that.&lt;br /&gt;
&lt;br /&gt;
		SwingUtilities.invokeLater(() -&amp;gt; {&lt;br /&gt;
			viewerPanel.handleControlChange();&lt;br /&gt;
			viewerPanel.repaint();&lt;br /&gt;
			ShowImages.showWindow(viewerPanel, &amp;quot;Point Cloud&amp;quot;, true);&lt;br /&gt;
		});&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
</feed>