WorldViz User Forum getPosition coordinates
 Register FAQ Search Today's Posts Mark Forums Read

#1
01-16-2007, 07:41 PM
 AlyssaK Member Join Date: Dec 2006 Posts: 16
getPosition coordinates

Hi everyone,

I'd like to find out the exact coorindates of a given object in order to insert other objects relative to this position.

I've looked at all the get methods. getPosition returns the x,y,z how could i find out each of these seperately? Is there a method that i've overlooked?

Just wanted to post a quick question before i went ahead with parsing the output of getPosition.

Thanks.
#2
01-17-2007, 09:22 AM
 farshizzo WorldViz Team Member Join Date: Mar 2003 Posts: 2,849
I'm not exactly sure what you are needing. getPosition() will return the exact (x,y,z) coordinates of the objects local origin. Is the object underneath a hierarchy of other objects? If so, then you will need to call getPosition(viz.ABS_GLOBAL) to get the true world coordinates of the object.
#3
01-17-2007, 03:29 PM
 AlyssaK Member Join Date: Dec 2006 Posts: 16
Sorry i don't think i explained the question clearly.

getPosition does return the x,y,z coordinates. What i am looking for is to set the position of a second or third object etc. relative to the position of the first object.

i.e. First object getPosition returns (2,5,10)
then x = 2, y = 5, z = 10

Second object setPosition(x, y+10, 10)

I'd like to find the values of x, y, and z seperately so that i can implement the above.

#4
01-18-2007, 09:24 AM
 farshizzo WorldViz Team Member Join Date: Mar 2003 Posts: 2,849
The following code should do what you are asking for:
Code:
```x,y,z = object1.getPosition()

object2.setPosition(x,y+10,10)```
Let me know if I still misunderstood your question.
#5
01-18-2007, 04:19 PM
 AlyssaK Member Join Date: Dec 2006 Posts: 16
Thankyou that is exactly what i was after!

I just assumed you needed to call a different function to retrieve each of the coordinates seperately.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Getting Vizard Help with AI Announcements Vizard Precision Position Tracker (PPT) Plug-in development

All times are GMT -7. The time now is 05:24 PM.