Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Weasels Color Camera
- @inputs Ds:wirelink
- @persist Y Range E:entity O:entity
- interval(100) #Increase if hard quota is exceeded
- if(first() | changed(Ds)){
- Range = 500 #Set the range of the Ranger trace here
- Ds[1048569]=3 #Changes Number Format to RRRGGGBBB
- E = entity()
- Y = 129
- O = owner()
- }
- if(O:keyUse()){
- Ds[1048574]=1 #Clears Digital Screen
- Y = 0 #Reset Y Value
- }
- for(X = 0,128){ #Loop code from X = 0 to X = 128
- if(Y>128){
- exit() #When done stop the for loop until reset
- }
- Ranger = ranger(Range,(X-64)/64,(Y-64)/64) #Set up Ranger with X Y skew
- LDir = (E:pos()-Ranger:position()):normalized() #Find the Light Direction
- DistSc = (Range - Ranger:distance())/Range #Generate a variable between 0 and 1 to "
- [07/15/11 12:44:35] [D3] i r Mr.weasel (STEAM_0:0:31200483) Ran: wire_expression_upload_data "darken into the distance
- Shade = Ranger:entity():getColor()*DistSc*LDir:dot(Ranger:hitNormal()) #Get the Shaded Colour of the pixel
- Clr = rgb2digi(Shade,3) #Turn Shade into the correct format
- Ds[X+ Y*128]= Clr #Plot pixel
- }
- Y++ #Goto next line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement