Register FAQ Search Today's Posts Mark Forums Read

#1
02-25-2011, 08:47 AM
 new_horizon Member Join Date: Apr 2010 Posts: 43

Hi All,

Another question regarding lighting :-) I am trying to create motorcycle headlights that illuminate the road as they travel forward - I have created the following, which seems to work - but with a slightly strange effect...

(Please note, you can insert any image in place of "tarmac.jpg"

import viz
import vizact
import math
import random
from numpy import *
viz.go()

#Set the viewpoint's position and orientation so that we'll be able to see our scene.
viz.MainView.setPosition( [0,0.8,20 ] )
viz.MainView.setEuler( [-180,4, 0] )

sun_light.position(0,100,-70,1)
# Give light sunish color and intensity
sun_light.color ([1,1,1])
sun_light.intensity(-1)

ball.appearance(viz.TEXMODULATE)

ball.setPosition([ 0 , 10.75 , 0 ])

#Add a model of a torch and place it in the scene.
viz.startlayer(viz.POLY_FILL)
viz.vertexcolor(1,1,1)
NUM_DOTS = 10000.0
for i in range(0, NUM_DOTS):
angle= 360.0*(i/NUM_DOTS)
# Put a vertex at each of these, but jump back to zero in between
viz.vertex(0,0)
viz.vertex(x,y)
headlight1.setPosition( [ 0 , 0 , -20 ])
#Add a light for the torch.
#Make the light positional.
flash_light.position(0,0,0,1)
flash_light.intensity(100)
#Make this positional light a spot light by limiting its spread.
#flash_light.spotexponent( 10 )
flash_light.constantattenuation(0)
flash_light.linearattenuation(1)

#Link the light source to the torch.

Can anyone shed any light on what is happening here?

Best wishes!

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post new_horizon Vizard 12 02-24-2011 08:11 AM Weihua An Vizard 5 08-02-2010 06:49 AM atamasan Vizard 2 03-09-2010 09:13 PM billjarrold Vizard 2 01-11-2010 08:51 AM dan12345 Vizard 1 01-15-2008 10:15 AM

All times are GMT -7. The time now is 07:43 PM.