Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Painless way to do 3D visualization

Reply
Thread Tools

Painless way to do 3D visualization

 
 
Peter Beattie
Guest
Posts: n/a
 
      10-07-2006
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
 
Reply With Quote
 
 
 
 
faulkner
Guest
Posts: n/a
 
      10-07-2006
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


 
Reply With Quote
 
 
 
 
Peter Beattie
Guest
Posts: n/a
 
      10-08-2006
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
 
Reply With Quote
 
Ron Adam
Guest
Posts: n/a
 
      10-08-2006
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[i],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])


 
Reply With Quote
 
Erik Max Francis
Guest
Posts: n/a
 
      10-08-2006
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.velocityreviews.com/forums/(E-Mail Removed) && 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tech Article: Fork and Join: Java Can Excel at Painless ParallelProgramming Too! Tori Java 1 08-10-2011 04:15 PM
Tech Article: Fork and Join: Java Can Excel at Painless ParallelProgramming Too! Tori Java 1 08-10-2011 04:15 PM
[ANN] MagicLoader 0.10.0: painless code dependency management Tony Arcieri Ruby 0 10-26-2010 03:25 PM
video and visualization window not showing when minimized =?Utf-8?B?cmVhbHRvcmpvcmdlMjM=?= Microsoft Certification 0 12-10-2005 12:36 AM
Software for IP-accounting visualization and analysis Dmitriy Stepanenko Cisco 0 06-25-2004 08:27 AM



Advertisments