Group Abstract Group Abstract

Message Boards Message Boards

Get reasonable interactive 3D plots with ~500000 points?

I need to plot a dataset of about 500000 (x,y,z) points (scattered 3D plot, using ListPointPlot3D and simultaneously Plot3D to compare to a smooth surface). I want to be able to rotate it, etc. In the computers I have access to, the interface starts to get slow at about 50000 points. Example:

n = 50000;
xmax = 50.0;
ymax = 20.0;
x = RandomVariate[UniformDistribution[{0.0, xmax}], n];
y = RandomVariate[UniformDistribution[{0.0, ymax}], n];
z = 30.0 - 15.0*(x + y)/70.0 + RandomVariate[NormalDistribution[0.0, 0.5], n];
Show[{Plot3D[30.0 - 15.0*(x + y)/70.0, {x, 0.0, xmax}, {y, 0.0, ymax}, ImageSize -> 600], ListPointPlot3D[{x, y, z}\[Transpose], ImageSize -> 600]}]

For n=500000, it takes very long to produce a graph and it then freezes if I try to rotate it. I can trim the data (create bins and then take small samples from each bin), but I was looking for ways to optimize the plotting so that it can handle more points without trimming.

Thanks,

OL.

POSTED BY: Otto Linsuain
11 Replies
POSTED BY: Szabolcs Horvát
Anonymous User
Anonymous User
Posted 9 years ago

oh. then you want a visual of two 3d planes (in which case use a 3d mesh not points, 2D "ledger dots" are slower), or use 3d (triangles) for both planes

or: plot the difference between the two instead, perhaps coloring to show thickness, which will be much easier to view

what your trying to do is not supposed to be efficient, which i tried to say above in previous replies

POSTED BY: Anonymous User
Posted 9 years ago
POSTED BY: Jim Baldwin
POSTED BY: Otto Linsuain
Posted 9 years ago

If your data is generated from a known random process what good is showing 500,000 sample points as opposed to 5,000? (I'm not suggesting there isn't a reason for doing so. I'm only stating that it is not obvious.) If the data generating process is completely known, then displaying the surface that contains, say, 95% of the probability (with some appropriate restrictions such as including the (x,y,z) locations with the highest probability density values) might be desirable. (For example, in a two-dimensional case with a bivariate normal, then showing the elliptical contours containing various probabilities is common.)

So my question is why stick with just displaying the data points when with 500,000 sample points, you could estimate the distributional parameters and then display the underlying constant probability density surfaces?

POSTED BY: Jim Baldwin
POSTED BY: Otto Linsuain
POSTED BY: l van Veen
Anonymous User
Anonymous User
Posted 9 years ago
POSTED BY: Anonymous User
Anonymous User
Anonymous User
Posted 9 years ago

Unsure if mathematica does this, but (true) OpenGL cards (likely any 3d card) support "sphere". That's not off topic because each sphere is a mesh generated by the video card (which infact can be generated per frame, or held as a set of points, even altered, and rotated). If you generate a ball mesh you'll quickly see you need about 100 vertices to make it a ball shape - more like 1000 to make it nice sphere appearance.

In Mathematica 4.0 (excuse me i'm more familiar with it), I find Sphere... PlotPoints->50 a believable ball shape, 2400 vertexes, so 50k balls is more like over 2.4 x 5 x 10^7, vertexes minimum, well over 100 million.

Below is 50,000 objects that rotates like butter. (use triangle shapes for more speed is a 3d lesson)

Graphics3D[ Table[Pyramid[{{Random[], 0, 0}, {0, Random[], 0}, {-Random[], 0, 0}, {0, -Random[], 0}, {0, 0, Random[]}} + i], {i, 1, 50000}]]

you'll need to run it at 50 to see they are actaully pyramids

at any rate: rotating 50k objects will not be same as rotating a mesh with 50k points - be sure of that. (old true all-in-silicon opengl did just as well with polygon as pyramids, but gaming cards today are not optimized that way and do much better with pyramids, last i read about it)

POSTED BY: Anonymous User
Anonymous User
Anonymous User
Posted 9 years ago

I'm unsure i'm new to 11.0 myself

obviously, turn off automatic things you didn't above (Clipping, Axes, anything that might get evaluated while rotating)

this works pretty smoothly:

Graphics3D[
 Table[Sphere[{Random[], Random[], Random[]}, 0.01], {i, 0, 1000}]]

but it's 1,000 objects - each object has many "texels" in 3d lingo (each ball has a whole plane of vertices). video games typically have high vertex count but low(er) object count, and objects at a distance are specially obstructed / blurred because: they aren't fully being rendered.

50,000 objects is allot. I think there is some thing here where your drawing 50,000 objects not a single mesh model with 50,000 vertices (say, a mesh of some object like and airplane) and expecting 50,000 rendered shaded objects to be the same speed as 50,000 vertexes object who's surface is shaded 1x. rotating the two would not be the same "job".

i see the same thing you do but usure if that is "blazing fast" or "slow and un-optomized" (if it re-evaluates all per degree of rotation to avoid storing sets of points in memory?). i am pretty sure that any slowness is like mm adding things like Axes or other extras who's viewing quality are preffered to flat out speed.

interesting question

POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard