Painless way to do 3D visualization

Discussion in 'Python' started by Peter Beattie, Oct 7, 2006.

  1. Hey folks,

    I need to do the following relatively simple 3D programming:

    I want to convert data from four-item tuples into 3D co-ordinates in a
    regular tetrahedron. Co-ordinates come in sequences of 10 to 20, and the
    individual dots in the tetrahedron need to be connected into
    discontinuous lines. A single tetrahedron should contain at least two,
    possibly more, such lines. I would like to show certain similarities in
    the sequences/lines, eg by changing color, thickness, or maybe attaching
    indeces to certain points in a particular sequence.

    I'd welcome suggestions as to what might be the most painless way to
    achieve this in Python. So far, I've only tinkered a little with
    VPython, but the lack of any decent documentation has proved to be a
    major turn-off.

    TIA!

    --
    Peter
     
    Peter Beattie, Oct 7, 2006
    #1
    1. Advertising

  2. Peter Beattie

    faulkner Guest

    http://www.vpython.org/

    Peter Beattie wrote:
    > Hey folks,
    >
    > I need to do the following relatively simple 3D programming:
    >
    > I want to convert data from four-item tuples into 3D co-ordinates in a
    > regular tetrahedron. Co-ordinates come in sequences of 10 to 20, and the
    > individual dots in the tetrahedron need to be connected into
    > discontinuous lines. A single tetrahedron should contain at least two,
    > possibly more, such lines. I would like to show certain similarities in
    > the sequences/lines, eg by changing color, thickness, or maybe attaching
    > indeces to certain points in a particular sequence.
    >
    > I'd welcome suggestions as to what might be the most painless way to
    > achieve this in Python. So far, I've only tinkered a little with
    > VPython, but the lack of any decent documentation has proved to be a
    > major turn-off.
    >
    > TIA!
    >
    > --
    > Peter
     
    faulkner, Oct 7, 2006
    #2
    1. Advertising

  3. faulkner wrote:
    > http://www.vpython.org/


    Oh, thanks, but let me quote myself:

    >> So far, I've only tinkered a little with VPython, but the lack
    >> of any decent documentation has proved to be a major turn-off.


    So, I'd really appreciate any hints as to where to look for anything a
    little more usable.

    --
    Peter
     
    Peter Beattie, Oct 8, 2006
    #3
  4. Peter Beattie

    Ron Adam Guest

    Peter Beattie wrote:
    > Hey folks,
    >
    > I need to do the following relatively simple 3D programming:
    >
    > I want to convert data from four-item tuples into 3D co-ordinates in a
    > regular tetrahedron. Co-ordinates come in sequences of 10 to 20, and the
    > individual dots in the tetrahedron need to be connected into
    > discontinuous lines. A single tetrahedron should contain at least two,
    > possibly more, such lines. I would like to show certain similarities in
    > the sequences/lines, eg by changing color, thickness, or maybe attaching
    > indeces to certain points in a particular sequence.
    >
    > I'd welcome suggestions as to what might be the most painless way to
    > achieve this in Python. So far, I've only tinkered a little with
    > VPython, but the lack of any decent documentation has proved to be a
    > major turn-off.
    >
    > TIA!


    What exactly are the four-items in the tuples?


    I think this is what you need along with an example...


    http://www.vpython.org/webdoc/visual/curve.html




    from visual import *

    # a simple polygon

    points = [(0,0,0),(0,1,0),(1,1,0),(1,0,0),(0,0,0)]
    curve(pos=points, color=color.red)


    # a polygon as separate segments grouped together in a frame.

    square2 = frame()
    points = [(0,0,1),(0,1,1),(1,1,1),(1,0,1),(0,0,1)]
    for i in xrange(len(points)-1):
    curve(frame=square2, pos=[points,points[i+1]], color=color.blue)
    square2.objects[2].color = color.green # change a line segments color
    square2.objects[2].radius = .02 # change a line segments thickness


    # looking at objects after they are made.
    print square2
    print dir(square2)
    print square2.objects
    print dir(square2.objects[0])
     
    Ron Adam, Oct 8, 2006
    #4
  5. Peter Beattie wrote:

    > faulkner wrote:
    >> http://www.vpython.org/

    >
    > Oh, thanks, but let me quote myself:
    >
    >>> So far, I've only tinkered a little with VPython, but the lack
    >>> of any decent documentation has proved to be a major turn-off.

    >
    > So, I'd really appreciate any hints as to where to look for anything a
    > little more usable.


    There's also ZOE:

    http://www.alcyone.com/software/zoe/

    but if a lack of documentation turned you off to VPython then ZOE is
    probably not for you either.

    --
    Erik Max Francis && && http://www.alcyone.com/max/
    San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
    No need to tell her there's a world out there / She knows / She just
    doesn't seem worried at all -- Nik Kershaw
     
    Erik Max Francis, Oct 8, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HPjtune
    Replies:
    0
    Views:
    1,175
    HPjtune
    Aug 25, 2003
  2. Replies:
    3
    Views:
    411
  3. Tori
    Replies:
    1
    Views:
    355
  4. Tori
    Replies:
    1
    Views:
    355
  5. Tony Arcieri
    Replies:
    0
    Views:
    157
    Tony Arcieri
    Oct 26, 2010
Loading...

Share This Page