This isn't something WPF is particularly well-suited for; it's 3D capabilities, while backed by hardware acceleration eventually, are very abstract and high-level.
Using only technology built-in to WPF itself, your best bet is probably to leverage the MeshGeometry3D
class. This object has a list of 3D positions and a list of indices into that 3D position list. Every three indices into the position list define a triangle with the three referenced position points. Thus, you'd need to:
- Generate your 3D point cloud.
- Turn each point into some simple 3D primitive (such as a quad defined by two triangles within a plane perpendicular to the view direction).
- Insert those points, and corresponding indices, into the relevant lists.
- Bind those lists to a
MeshGeometry3D
object (or just instantiate one at runtime).
While you might be able to come up with a method that is simpler in code (in particular by avoiding the second step by simply placing a bunch of pre-defined geometry objects, like cubes or 2D rectangles adjusted by depth to fake perspective), you are likely to run into scale problems much sooner given the overhead of each point in such an approach. Stuffing everything into a single object eliminates much of that overhead for improved scaling and performance. Plus, it doesn't require you to recompute every point when the camera rotates as you would in the projected 2D case (instead, you adjust the object's 3D transform property).
If you are okay with a solution that uses external dependencies, the Helix toolkit provides a bunch of simple 3D primitives and utilities that will likely take a large chunk of the grunt work out of the above implementation.
GL_POINTS
usingglVector3f(x,y,z)
and usegluLookAt()
for the camera that rotates around the cloud. – Quetzalcoatl Mar 09 '13 at 19:46x*f/Z, y*f/Z
wheref
is the approximate distance of the user from the monitor andZ
is the imaginary distance of the point from the user. If these points have a radius, you could multiply it by that value as well. The issue here is that you need over a million points at once. That sounds like something you'd want accelerated. – AturSams Mar 22 '14 at 17:00