Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: 3D Dot "Graph" with motion

by moklevat (Priest)
on Mar 19, 2008 at 13:45 UTC ( [id://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];

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found