Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: 3D Dot "Graph" with motion

by moklevat (Priest)
on Mar 19, 2008 at 13:45 UTC ( #674998=note: print w/ replies, xml ) Need Help??

in reply to 3D Dot "Graph" with motion

Lu's suggestion to use PDL is what I would do if you want to run the visualization "live". I would go with moritz's approach if you want to store the visualization as an animation for later playback. Here is a brief example of a 3D visualization of points using PDL adapted from one of the examples from the docs. The nokeeptwiddling3d() function is what allows the changes in position to be plotted while the iteration happens. If you remove that then you can step through each change in position by pressing the "q" key.

#!/usr/bin/perl -w use strict; use PDL; use PDL::Graphics::TriD; my $size = 25; my $x = (xvals zeroes $size+1,$size+1) / $size; my $y = (yvals zeroes $size+1,$size+1) / $size; my $z = 0.5 + 0.5 * (sin($x*6.3) * sin($y*6.3)) ** 3; # Bumps my $r = $x; my $g = $y; my $b = $z; nokeeptwiddling3d(); for (1..50){ points3d [$x,$y,$z], [$r,$g,$b]; # Draw several colored dots $x+=$y*$z; } keeptwiddling3d(); points3d [$x,$y,$z], [$r,$g,$b];

Comment on Re: 3D Dot "Graph" with motion
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://674998]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-11-29 07:09 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (748 votes), past polls