thenetfreaker has asked for the wisdom of the Perl Monks concerning the following question:

Good morning monastery,
Can anyone please advice me a good module for creating a 3D object, though not an as if 3D xy/pie graph,
but an xyz space where i would be able to create coloureful dots by coorditates ?

Thanks in advance.

P.S.: -304805 < (x=y=z)< 304805

Replies are listed 'Best First'.
Re: 3D module
by moklevat (Priest) on Jan 21, 2006 at 17:17 UTC
    I would suggest that you look into PDL, the Perl Data Language. There are some screenshots to whet your appetite. One very nice feature of PDL is that it has an interactive shell and some built-in demos for working through problems.

    Here is a very simple example that displays a 3D plot of four points with 4 different colors in an X window. You can click and drag in the window to change the view.
    #!/usr/bin/perl use strict; use PDL; use PDL::Graphics::TriD; my $coordinates = pdl [[10,10,0], [0,10,0], [1,1,1], [-10,-10,-10]]; my $colors = pdl [[50,50,50], [50,0,50], [50,50,0], [0,0,50]]; points3d $coordinates, $colors, {PointSize=>2};
    update:Removed unnecessary keeptwiddling3d() loop.
      Hello,
      i found it and SDL as nice approaches, bust as BrowserUk mentioned that it "... would require your computer to have approximately 226 PetaBytes of RAM."; because as i found out - "SDL_Init 65535", which means that it wouldn't even work for 100*100*100.
      What considering PDL, i did a( maybe that's the problem) few testing which resulted not better.
      Even on Windows platform, i serched for an app like Paint-Brush( because of its lurge x,y coordinates( something like 300,000*300,000)) but 3D, and found nothing.
      I even hoped Macromeria products could evantually become handy for me, but than i found out how pourly coordinated they are.

      If anyone can think of a comprihancive way to present such a Matrix,
      please inform me.

      P.S.: If anyone is inerested in what on Earth am i creating, i would more than glad to tell that i'm working on a matrix representation of the (Jewish) Torah (which has 304805 letters), and i what to "paint" each letter in a spesific colour, and so when i'll look-for a spesific word i'm more than sure that i'll see its (coloureful 3D) image among the letters ( when as if conecting the matching letters by lines - like drawing on stars).

        It's an interesting idea, but even if you had the memory to hold it, you would need a 10,160 (80x127 grid) of the highest resolution LCD displays to be able to display a single slice through it. And that would be roughly 38 meters square!

        At $8,000 a throw, that comes to around US$80 million. You might get a bulk purchase discount, but I doubt it would really help :)

        On a more serious note, given that you are going to be unable to display the whole thing, or even a significant chunk of it in one go, it would be best to look at taking a different tack. Rather than building the whole thing and then displaying bits of it, you could build the bit you can display only, and then as you scroll around, you delete the bits that are leaving the screen and draw the new bits on the other side (top/bottom etc.). This is basically how those mega-world video games work.

        That said, I am having great difficulty in tryng to visualise what it is you are attempting to display. Maybe you could try and explain using a limited alphabet (a-e?) and some ascii art?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        A reply falls below the community's threshold of quality. You may see it by logging in.
Re: 3D module
by CountZero (Bishop) on Jan 21, 2006 at 16:03 UTC
    Or perhaps OpenGL?

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: 3D module
by moot (Chaplain) on Jan 21, 2006 at 15:42 UTC
    Would something like SDL be useful?
Re: 3D module
by zentara (Cardinal) on Jan 21, 2006 at 17:59 UTC
    To amplify on SDL, there are 3D plot examples in SDL_Perl-2.1.3/test/OpenGL

    test5.pl is very good looking


    I'm not really a human, but I play one on earth. flash japh
Re: 3D module
by BrowserUk (Patriarch) on Jan 21, 2006 at 15:59 UTC
    but an xyz space where i would be able to create coloureful dots by coorditates ?

    As your dots are going to be colorful, you presumably intend for them to be viewed?

    If so, how do you intend for them to be viewed?

    P.S.: -304805 < (x=y=z)< 304805

    To manage that volume of 3D space, assuming just 8-bit color, would require your computer to have approximately 12 226 PetaBytes of RAM. To put that into a rough context, according to one source on the web, that is roughly half as much again 30 times as much data as is currently available on the entire WWW put together.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.