WorldViz User Forum viz.vertex coordinates
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

#1
05-13-2009, 10:43 AM
 lilio Member Join Date: May 2009 Posts: 11
viz.vertex coordinates

Hello,

I want to create a vertex at the mouseclick position, but I don't know how to do it.

If I create two vertex points:
Code:
```viz.startlayer(viz.POINTS)
viz.pointsize(10)
viz.vertexcolor(viz.RED)
viz.vertex(0,0,10)
viz.vertex(1,1,10)
line = viz.endlayer()```
And afterthat I click with my mouse at these points and look at my output window:
Code:
`print viz.mouse.getPosition()`
Then I had to recognize, that there are absolutly different values.

The vertex are at [0,0,10] and [1,1,10] and my mouseposition shows [0.6,0.3] and [0.5,0.2]!

Are the vertex coordinates world coordinates? Or what means 0,0,10? And what are the mouseposition coordinates?

What's the reason for this difference. I want to create vertex at the mouseclick position.

Can anybody help me - please.
#2
05-14-2009, 03:31 AM
 lilio Member Join Date: May 2009 Posts: 11
If I create the vertex with this command:

Code:
`point = viz.endlayer(viz.WORLD)`
then the vertex will be placed at another position like the mouse is.

But if I use

Code:
`point = viz.endlayer(viz.SCREEN)`
then the vertex will be placed at the mouseclick position.

But I don't want to place the vertex at the screen. It should be placed in the world at the mouseposition and at 0 on the z-axis.

I hope somebody understand my problem.

I only want to create a vertex in the world (not at the screen), but exactly at the mouseposition.

Is this possible?
#3
05-14-2009, 10:56 AM
 Gladsomebeast Member Join Date: Mar 2005 Location: Isla Vizta, CA Posts: 397
Use the "screentoworld" method to get a direction vector. Then use vizmat.MoveAlongVector to find a place in space.
__________________
Paul Elliott
WorldViz LLC
#4
05-15-2009, 04:25 AM
 Chrissy2009 Member Join Date: May 2009 Posts: 33

I've got the same problem. I want to create points in the world, not on the screen.

But I don't understand your answer. Could you write down the code, please?

THANKS!
#5
05-15-2009, 11:58 AM
 Gladsomebeast Member Join Date: Mar 2005 Location: Isla Vizta, CA Posts: 397
Looks like we don't need MoveAlongVector. Got this code from viztracker.py:

Code:
```line = viz.screentoworld(viz.Mouse.getPosition())
line.length = desiredMetersFromView
print line.end```
__________________
Paul Elliott
WorldViz LLC
#6
05-16-2009, 09:09 AM
 Chrissy2009 Member Join Date: May 2009 Posts: 33
Oh great, thanks a lot!!
#7
05-16-2009, 04:36 PM
 Gladsomebeast Member Join Date: Mar 2005 Location: Isla Vizta, CA Posts: 397
Helping make me happy.
__________________
Paul Elliott
WorldViz LLC

 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 Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post v-Salik Vizard 1 10-19-2007 03:41 PM AlyssaK Vizard 4 01-18-2007 04:19 PM shivanangel Vizard 4 10-30-2006 08:28 PM vrhelp2004 Vizard 1 05-18-2004 04:53 PM

All times are GMT -7. The time now is 03:52 AM.

 Contact Us - WorldViz Home - Archive - Top