WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-20-2011, 08:15 AM
Zword Zword is offline
Member
 
Join Date: Jan 2011
Posts: 6
array select 1 value

question

Code:
for cod in wall_1.getPosition()
	print cod
This will print the x y z coordinates. Now all i want is the z coordinate value. How?
Reply With Quote
  #2  
Old 01-20-2011, 08:33 AM
Darkmax Darkmax is offline
Member
 
Join Date: Feb 2010
Posts: 108
Code:
for cod in wall_1.getPosition()
	print cod[2]
Reply With Quote
  #3  
Old 01-20-2011, 08:41 AM
Zword Zword is offline
Member
 
Join Date: Jan 2011
Posts: 6
tried that doesn't work


Traceback (most recent call last):
File "<string>", line 11, in ?
File "Test wall.py", line 106
for cod in wall_1.getPosition()
^
SyntaxError: invalid syntax
Reply With Quote
  #4  
Old 01-20-2011, 09:38 AM
Zword Zword is offline
Member
 
Join Date: Jan 2011
Posts: 6
The point is that my z coordinate is constantly reset to 0.5 but what i want is that it get the object.getPosition += 0.5


Code:
def moveWallBackward ():
    global pos
    object = viz.pick()
    if object.valid():
        pos -= 0.5
        object.setPosition([0,-4,pos])
vizact.onkeydown( 'j', moveWallBackward )
Reply With Quote
  #5  
Old 01-24-2011, 12:41 PM
vOliver vOliver is offline
Member
 
Join Date: Sep 2010
Posts: 6
cod = wall_1.getPosition()
print cod[2]
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Array, concatenate, multiple path help please sircedric4 Vizard 3 10-28-2009 05:14 AM
Semi-circle array containing target and distractor objects ptjt255 Vizard 3 08-04-2009 03:09 AM
2D or 3D array help? durf Vizard 1 02-20-2009 10:57 AM
How can I select and move an object? nlfrnassimi Vizard 1 02-11-2009 01:08 AM
Copy objects in an array to another array Johannes Vizard 3 04-29-2005 02:37 PM


All times are GMT -7. The time now is 12:45 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC