WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 08-21-2008, 01:49 PM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
Okay. One annoying undocumented bug down. I'm getting other strange effects too.

Firstly, based on my initial tests, the setting viz.lightModel.twoSided (default=0) seems to imply 0="make the back look just like the front" and 1="make the back respond realistically to light". Consider the following code:
Code:
headLight = viz.MainView.getHeadLight()
headLight.disable()
myLight = viz.addLight()
myLight.enable()
myLight.position(0,1,0,0) #make a "sun"
myLight.spread(180)
myLight.intensity(1)
myLight.color(viz.WHITE)

viz.startlayer(viz.QUADS)
viz.vertexcolor(0.8,0.4,0.4)
viz.normal(0,0,-1)
viz.vertex([1,1,0])
viz.vertex([-1,1,0])
viz.vertex([-1,-1,0])
viz.vertex([1,-1,0])
obj = viz.endlayer() #make square in the XY plane at Z=0
obj.setEuler(0,30,0)
obj.setPosition(0,0,1)
obj.enable(viz.LIGHTING)
With viz.lightModel.twoSided=0 both sides look pink, but with viz.lightModel.twoSided=1 the top side looks pink, while the bottom side is darker. What is really odd is that if I draw a disc with:
Code:
viz.startlayer(viz.POLYGON)
viz.vertexcolor(0.8,0.4,0.4)
viz.normal(0,0,-1)
for i in range(32):
	radians = 2*math.pi*i/32
	viz.vertex([0.1*math.sin(radians),0.1*math.cos(radians),0])
	viz.vertex([0.1*math.sin(radians),0.1*math.cos(radians),0])
obj = viz.endlayer()
and do the same thing as above, the bright and dark faces seem to get swapped. Both the square and the disk are drawn counter-clockwise, and have the same normals, so what gives?

When I start grouping these objects together, and setting the color for the group, then the dark sides get even darker. I now think I understand that this is because the bug described above. Please correct me if I'm wrong.
Reply With Quote
 


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
lighting issue cantwelljm Vizard 3 02-18-2006 08:21 AM
The effect of lighting on performance JRichizzle Vizard 1 06-18-2004 10:40 AM
Problems with lighting in 2.0 murm Vizard 6 04-21-2004 09:59 AM
Lighting Problem Plasma Vizard 1 02-03-2004 11:09 AM
Vizard 2.0x lighting FlyingWren Vizard 4 08-11-2003 12:20 PM


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


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