LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2008, 02:30 PM   #1
raskol
Member
 
Registered: Mar 2008
Posts: 51

Rep: Reputation: 15
Visual Python: problem changing coordinates of cylinder


using www.vpython.org.

according to:
http://www.vpython.org/webdoc/visual/cylinder.html
http://www.vpython.org/webdoc/visual/index.html
it should work when updating position but the folowing happens:

i get this:

Traceback (most recent call last):
File "C:\Users\saftarn\Desktop\pythonkod\cyl.py", line 13, in <module>
rod.pos(15,11,8)
TypeError: 'Vector' object is not callable


when running this:

Code:
from visual import *

rod = cylinder(pos=(0,0,0), axis=(1,3,0), radius=0.3)
rod.color = (0,0,2)

for haha in range (1000000):
    x=2
    x=x+x+x+x+x+x/2

rod.color = (1,0,0)
rod.pos(0,0,6)

anyone can tell me what im doing wrong?
the color changes but the placement of the cylinder doesnt.
the for-loop is just so i can see that it is first blue then red. is there a pause(time)-function in python?

Last edited by raskol; 04-02-2008 at 02:32 PM.
 
Old 04-03-2008, 01:10 PM   #2
kolargol
Member
 
Registered: Jan 2003
Posts: 56

Rep: Reputation: 3
Should be

rod.pos=(0,0,6)
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy data from cylinder X to cylinder Y? szotsaki Linux - Hardware 4 07-22-2007 11:25 AM
Changing the visual theme DesignerX Mandriva 4 06-23-2007 01:45 AM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 07:54 PM
installing visual python : gtk present but unfound Dominik Linux - General 0 12-26-2003 10:31 AM
Visual Python/Numpy uranologist Linux - Software 0 09-28-2003 10:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration