WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-10-2010, 07:25 PM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
Question 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)?
Reply With Quote
  #2  
Old 11-10-2010, 07:57 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #3  
Old 11-13-2010, 09:35 AM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
Thank you very much.
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
Show Physics Shapes bloswald Vizard 3 04-07-2010 04:16 PM
How to make screen black? Josh Vizard 1 04-02-2010 01:30 PM
How to make character animation sequence wchoi Vizard 3 01-22-2010 09:35 AM
cinematic fade to black? billjarrold Vizard 4 12-23-2009 12:09 PM
black outs enkeli Vizard 4 05-09-2006 01:05 PM


All times are GMT -7. The time now is 09:02 PM.


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