WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   intersection with texquad (

pitbool 07-24-2017 07:25 PM

intersection with texquad

If we use texquads as objects that intersect with a ray from the vive controller, is there a way to change the names of the texquads to have something other than "drawable"? Already tried hardcoding the name to something like below, but didn't work:
myTexQuad = viz.addTexQuad(size=[1.21, 1.71]) = "texQuadCustomName"

The intersection with the vive controller is the standard function from the worldviz example for vive that shipped with vizard (below). It returns the intersected object, which could be a VizChild or a VizTexQuad.

def IntersectController(controller):
"""Perform intersection using controller"""
line = controller.model.getLineForward(viz.ABS_GLOBAL, length=100.0)
return viz.intersect(line.begin, line.end)

Jeff 07-24-2017 10:09 PM

First check to see if the intersected object is the quad, then get the name attribute you assigned to it. Does that work for you?

import viz

myTexQuad = viz.addTexQuad(pos=[0,1.8,2]) = "texQuadCustomName"

info = viz.intersect([0,1.8,0],[0,1.8,4])
if info.valid:
        if info.object == myTexQuad:

pitbool 07-25-2017 12:14 PM

yes, that code works by itself - thanks!

For the purposes of our project, just using the following variant:
listOfQuads = []
if info.object is in listOfQuads:

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

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