G2A Many GEOs
SHARE
TWEET

RayTracer sample

kssr3951 Oct 6th, 2015 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- NichePeripherals(https://github.com/kssr3951/NichePeripherals)
  2. -- のRayTracerのサンプル
  3. l = peripheral.wrap("left")
  4. while true do
  5.   ray = {
  6.     {-1.0, 0},
  7.     {-0.8, 0},
  8.     {-0.6, 0},
  9.     {-0.4, 0},
  10.     {-0.2, 0},
  11.     { 0.0, 0},
  12.     { 0.2, 0},
  13.     { 0.4, 0},
  14.     { 0.6, 0},
  15.     { 0.8, 0},
  16.     { 1.0, 0}}
  17.  
  18.   rslt = { l.rayTrace(1.0, ray) }
  19.  
  20.   term.clear()
  21.   term.setCursorPos(1, 1)
  22.   for i, v in ipairs(rslt) do
  23.     print(v)
  24.   end
  25.   os.sleep(0.1)
  26. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top