Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2014-09-30 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (384 votes), past polls