Plotting a point cloud with jzy3d ( opengl / jogl )

5 views (last 30 days)
Jim
Jim on 12 Sep 2013
Answered: Abhipsa on 16 Jun 2025
I have been using Malcolm Lidierth's excellent demo for plotting a surface with jzy3d; this works very well. Now I want to plot a point cloud with millions of points and I am struggling with how to adapt Malcolm's example code. I have tried looking at his Waterloo-jzy3d source code but this appears to be different to his binary jar file.
Please can anybody help me plot 3d points with jzy3d?
or
Has anybody got an alternative way of plotting 3d points in opengl/jogl from Matlab?
Jim

Answers (1)

Abhipsa
Abhipsa on 16 Jun 2025
Hello @Jim,
To plot millions of 3D points efficiently, MATLAB’s built-in graphics can work quite well.
The below code snippet generates 1 million random 3D points and uses "scatter" to plot them:
% Generate 1 million random 3D points
N = 1e6;
x = rand(1, N) * 100;
y = rand(1, N) * 100;
z = rand(1, N) * 100;
% Use scatter3 with performance optimizations
figure
scatter3(x, y, z, 1, '.', 'MarkerEdgeAlpha', 0.1);
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Large 3D Point Cloud');
view(3);
axis equal;
The output of the code snippet:
I hope this helps!

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!