WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-07-2016, 10:12 AM
blindberg blindberg is offline
Member
 
Join Date: Oct 2015
Posts: 7
pick intersect point in object coordinates

Is there a way to get the intersect point when picking using
Code:
viz.pick(info=True)
in the local coordinates of the object being picked?
Reply With Quote
  #2  
Old 01-12-2016, 02:51 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The command returns a point in global coordinates but you could convert this into local coordinates of the object that is picked:

Code:
import viz
import vizact
viz.go()

viz.addChild('piazza.osgb')
ball = viz.addChild('beachball.osgb',pos=[0,1.5,3])

def updatePick():
	info = viz.pick(info=True)
	if info.object == ball:
		print 'global',info.point
		helper = viz.addGroup(parent=ball)
		helper.setPosition(info.point, viz.ABS_GLOBAL)
		print 'local',helper.getPosition() #mode defaults to viz.ABS_PARENT
		
vizact.ontimer(1,updatePick)
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
viz intersect object point chris2307 Vizard 1 10-10-2014 02:31 PM
animate an object using 5dt data glove 5 ultra agrima Vizard 3 07-01-2014 11:17 AM
Find collision point of line and arbitrary object asdf Vizard 2 01-28-2013 10:04 AM
how to pick up the object, move and rotate using mouse nasr Vizard 5 05-05-2009 03:11 AM
Getting object position in screen coordinates v-Salik Vizard 1 10-19-2007 03:41 PM


All times are GMT -7. The time now is 04:43 AM.


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