WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   pick intersect point in object coordinates (https://forum.worldviz.com/showthread.php?t=5595)

blindberg 01-07-2016 10:12 AM

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?

Jeff 01-12-2016 02:51 AM

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)



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

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