Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. @name Weasels Color Camera
  2. @inputs Ds:wirelink
  3. @persist Y Range E:entity O:entity
  4.  
  5. interval(100) #Increase if hard quota is exceeded
  6.  
  7. if(first() | changed(Ds)){
  8. Range = 500 #Set the range of the Ranger trace here
  9. Ds[1048569]=3 #Changes Number Format to RRRGGGBBB
  10. E = entity()
  11. Y = 129
  12. O = owner()
  13. }
  14.  
  15. if(O:keyUse()){
  16. Ds[1048574]=1 #Clears Digital Screen
  17. Y = 0 #Reset Y Value
  18. }
  19.  
  20.  
  21. for(X = 0,128){ #Loop code from X = 0 to X = 128
  22. if(Y>128){
  23. exit() #When done stop the for loop until reset
  24. }
  25. Ranger = ranger(Range,(X-64)/64,(Y-64)/64) #Set up Ranger with X Y skew
  26. LDir = (E:pos()-Ranger:position()):normalized() #Find the Light Direction
  27. DistSc = (Range - Ranger:distance())/Range #Generate a variable between 0 and 1 to "
  28. [07/15/11 12:44:35] [D3] i r Mr.weasel (STEAM_0:0:31200483) Ran: wire_expression_upload_data "darken into the distance
  29. Shade = Ranger:entity():getColor()*DistSc*LDir:dot(Ranger:hitNormal()) #Get the Shaded Colour of the pixel
  30. Clr = rgb2digi(Shade,3) #Turn Shade into the correct format
  31. Ds[X+ Y*128]= Clr #Plot pixel
  32. }
  33.  
  34. Y++ #Goto next line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement