Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pretty = require("cc.pretty")
- --RendererH3+
- local main = require("engine")
- local per = peripheral.wrap("top")
- local can = per.canvas()
- local width,height = can.getSize()
- --[[local win
- local ot = term
- term = peripheral.find("monitor")
- term.setTextScale(0.5)
- term.setCursorPos(10,10)
- width,height = term.getSize()
- term = window.create(term,1,1,width,height)]]
- local objList = { frame=main.objects.newCube() }
- objList.frame.color = main.createColor({0xFF0000FF})
- objList.frame.loc.z = -8
- objList.frame.scale.x = 1.8
- objList.frame.scale.y = 1.8
- objList.frame.scale.z = 1.8
- local frames = 100000
- local st = os.epoch("utc")/1000
- local args = main.getDrawArgs()
- args.drawTriangles = true
- args.drawWireFrame = false
- args.doCulling = true
- for i=1,frames do
- objList.frame.rot.y = os.epoch()/2000
- objList.frame.rot.x = os.epoch()/3000
- can.clear()
- local pers = main.createPerspective(width,height,40)
- local cam = main.createCamera(vector.new(0,0,0),vector.new(0,0,0))
- local objectsInt = main.transform(objList,pers,cam)
- main.drawTransformed(can,objectsInt,args)
- sleep(0.05)
- end
- local et = os.epoch("utc")/1000
- local fps = frames/(et-st)
- print("FPS: "..fps)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement