WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-07-2011, 02:15 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Try using the <window>.screenToWorld command. Is this what you're looking for?
Code:
import viz
import vizact
viz.go()

viz.link( viz.Mouse,viz.addTexQuad(viz.SCREEN,texture=viz.add('crosshair.png')) )

def addBall():
	
	ball = viz.addChild('ball.wrl',cache=viz.CACHE_CLONE)
	line = viz.MainWindow.screenToWorld(viz.mouse.getPosition())
	pos = vizmat.MoveAlongVector(line.begin,line.dir,10)
	ball.setPosition(pos)
	
vizact.onmousedown(viz.MOUSEBUTTON_LEFT,addBall)

viz.mouse(viz.OFF)
Reply With Quote
 


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
Change textbox color? renama Vizard 2 10-19-2010 08:44 PM
Change Viewpoint in different scenes lilio Vizard 1 08-28-2009 03:56 PM
Change model alpha and memory leak hosier Vizard 2 06-25-2009 11:55 AM
viz.vertex coordinates lilio Vizard 6 05-16-2009 05:36 PM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 01:14 PM


All times are GMT -7. The time now is 10:49 PM.


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