WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Is it possible to have make my shapes have black borders? (https://forum.worldviz.com/showthread.php?t=3074)

Renato Lima 11-10-2010 06:25 PM

Is it possible to have make my shapes have black borders?
 
I have a series of shapes either added from a 3ds file or generated. Can I have them display a black line over each of their wirelines? (a black contour)?

farshizzo 11-10-2010 06:57 PM

Here is a sample script showing how to draw a black line over the wireframe of a model:
Code:

import viz
import vizact
viz.go()

viz.clearcolor(viz.GRAY)

frag_black = """
        void main()
        {
        gl_FragColor = vec4(0,0,0,1);
        }
        """
shader_black = viz.addShader(frag=frag_black)

def addWireOutline(node):
        node.wire = model.clone(parent=node)
        node.wire.polyMode(viz.POLY_WIRE,op=viz.OP_OVERRIDE|viz.OP_ROOT)
        node.wire.zoffset(op=viz.OP_OVERRIDE|viz.OP_ROOT)
        node.wire.apply(shader_black,op=viz.OP_OVERRIDE|viz.OP_ROOT)

model = viz.addChild('ball.wrl',pos=(0,1.8,2))

addWireOutline(model)

model.addAction(vizact.spin(0,1,0,90))

vizact.onkeydown(' ',model.wire.visible,viz.TOGGLE)

Let me know if I misunderstood what you were asking for, or if anything is unclear.

Renato Lima 11-13-2010 08:35 AM

Thank you very much.


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

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