WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   draw outline on objects? (https://forum.worldviz.com/showthread.php?t=5917)

Vaquero 12-11-2016 11:56 PM

draw outline on objects?
 
Hey! I saw that there's a highlighter tool, but it depends on the user picking items by sending a ray cast. I'd like to highlight objects that get chosen by my script (randomly from a list of items), not by the user.
Is there a way using the highlighter tool or do I have to create a shader effect?

Jeff 12-13-2016 03:53 PM

Yes, the highlighter module has an outline object that you can add models to directly:

Code:

import viz
import viztask

viz.setOption('viz.display.stencil',1)
viz.go()

environment = viz.addChild('sky_day.osgb')
soccerball = viz.addChild('soccerball.osgb',pos=[-0.5,1.8,2])
basketball = viz.addChild('basketball.osgb',pos=[0,1.8,2])
volleyball = viz.addChild('volleyball.osgb',pos=[0.5,1.8,2])
items = [soccerball,basketball,volleyball]

from tools import highlighter
outline = highlighter.Outline()

def outlineTask():
       
        while True:
               
                for item in items:
                        outline.add(item)
                        yield viztask.waitKeyDown(' ')
                        outline.remove(item)
                       
viztask.schedule( outlineTask() )



All times are GMT -7. The time now is 05:30 PM.

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