How can I load (many!) points from file, and display them in 3D including color?

1 view (last 30 days)
Hi,
I'm new to MATLAB
I need to upload many points from a file (up to 25 milion points, but about 15 milion points will also be enough) and display them in 3d space including the option to move them in all dicertions. I also want (if it's possible) to determine the Color of each point.
I create the input file by myself, so it's easy for me to change the format of this file to any format that Matlab can read.
For example it can be a simple text file in the format:
7850, 5394, 6240, 0x22578C
5172, 2958, 1852, 0x72B5A4
397, 1450, 42, 0xB4FC7A
.....
.....
where each line is a pixel: x, y, z, Color in RGB.
I can also create a binary file (for example: "InputPoints.bin") with the points data if it's easier for the Matlab to read.
So, I need to load all the points from my input file, and to show them as color points in a 3d space.
If adding color for each point is a problem, then for now points without a color will also be "OK", but points with color will be much better for what I need.
Please advice,
Thanks!

Answers (1)

dpb
dpb on 22 Jul 2019
Edited: dpb on 22 Jul 2019
See
doc scatter3
ML can read whatever datafile format you wish to use...for such large data a stream file would be obvious choice.
While 25E6 points is only roughly 300 in each of the three directions, even a large monitor may have only 2560x1440 pixels so even if each dot is represented by one pixel there's ~10X more points than pixels to display. In short, you'll likely just have a blob.
I don't know where ML will break down (or if it will) with number of points--the new(ish) scatter3 is a single object but how many internal handles it has to create I dunno...
  2 Comments
MathLab User
MathLab User on 22 Jul 2019
Edited: MathLab User on 22 Jul 2019
Thanks,
I'll check it, but does 'scatter3' allows me to load the points from a file?
Does it let me choose my own color for each one of the points that are loaded from this file?
dpb
dpb on 22 Jul 2019
Edited: dpb on 23 Jul 2019
Reading data is independent from plotting...there are a "veritable plethora" of options available; read the "Getting Started" doc links "Data Import and Analysis"
The examples for scatter3 in the documentation include all you need to know to do what you've asked and more... https://www.mathworks.com/help/matlab/ref/scatter3.html?searchHighlight=scatter3&s_tid=doc_srchtitle#btr5_il-1
Doesn't look/sound like you've done any exploratory work or reading at all to speak of...

Sign in to comment.

Categories

Find more on Data Import and Export 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!