Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- stereoMultiplier = 0.1
- function drawPoint(x,y,z)
- Screen.drawPixel(round(x-z*stereoMultiplier ,0), round(y,0), Color.new(255,0,0), TOP_SCREEN, LEFT_EYE)
- Screen.drawPixel(round(x+z*stereoMultiplier ,0), round(y,0), Color.new(255,0,0), TOP_SCREEN, RIGHT_EYE)
- end
- Vertex = {};
- function Vertex.new(x,y,z)
- local self = {}
- self.x = x
- self.y = y
- self.z = z
- return self
- end
- vert1 = Vertex.new(0,0,0)
- vert2 = Vertex.new(20,20,20)
- vert3 = Vertex.new(50,50,50)
- Screen.enable3D() --Enabling 3D for the top screen
- while(true) do
- Screen.waitVblankStart() -- Screen related stuff
- Screen.refresh() -- Other Screen related stuff
- Screen.clear(TOP_SCREEN) -- Clear top screen
- Screen.clear(BOTTOM_SCREEN) -- Clear bottom screen
- pad = Controls.read() -- Read Controls
- if(Controls.check(pad, KEY_START)) then-- check if start is pressed
- System.exit()-- Exit back to HBL
- end
- Screen.debugPrint(0,0,"Hello World",Color.new(255,255,255),BOTTOM_SCREEN) -- Print onto the bottom screen at (0,0), "Hello World" in white
- drawPoint(vert1.x,vert1.y,vert1.z)
- drawPoint(vert2.x,vert2.y,vert2.z)
- drawPoint(vert3.x,vert3.y,vert3.z)
- Screen.flip() -- More screen related stuff
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement