Ejemplo n.º 1
0
"""

from render import Render

gl = Render()
gl.CreateWindow(800, 800)

#Polygone 1:
gl.paint([(165, 380), (185, 360), (180, 330), (207, 345), (233, 330),
          (230, 360), (250, 380), (220, 385), (205, 410), (193, 383)],
         gl.rgbToColor(0, 1, 1))

#Polygone 2:
gl.paint([(321, 335), (288, 286), (339, 251), (374, 302)],
         gl.rgbToColor(1, 0, 0))

#Polygone 3:
gl.paint([(377, 249), (411, 197), (436, 249)], gl.rgbToColor(0, 1, 0))

#Polygone 4:
gl.paint([(413, 177), (448, 159), (502, 88), (553, 53), (535, 36), (676, 37),
          (660, 52), (750, 145), (761, 179), (672, 192), (659, 214),
          (615, 214), (632, 230), (580, 230), (597, 215), (552, 214),
          (517, 144), (466, 180)], gl.rgbToColor(0, 0, 0))

#Polygone 5:
gl.paint([(682, 175), (708, 120), (735, 148), (739, 170)],
         gl.rgbToColor(1, 1, 1))

gl.finish('lab.bmp')
Ejemplo n.º 2
0
"""
---------------------------------------------------------------------

Universidad del Valle de Guatemala
Saúl Contreras	18409
Gráficas por Computadora
SR2: Lines

This file is a test of the class render.py
---------------------------------------------------------------------
"""

from render import Render

gl = Render()										
gl.CreateWindow(600,300)								
gl.viewPort(300, 0, 300, 150)						#ViewPort should be the fourth quadrant of the image
gl.line(-1,0,0,1)									#Should draw a line in the left top corner of the view port. 
gl.line(-1,0,0,-1)
gl.line(1,0,0,-1)
gl.line(1,0,0,1)
gl.line(0,1,0,-1)
gl.line(1,0,-1,0)
gl.finish('test.bmp')								
Ejemplo n.º 3
0
from render import Render

#creating object
gl = Render()										#glinit is in the constructor of the class

#just image with noting in it
gl.finish('test1.bmp')							

#now modified to have 600x300 dimensions p
gl.CreateWindow(600,300)								
gl.finish('test2.bmp')										

#from x1 y1 --> to x2 y2 and make a rectangle
gl.viewPort(0, 0, 600, 300)					#ViewPort should be the fourth quadrant of the image
gl.vertex(0,0)
gl.color(1,0,0)	
gl.line(0,0,1,1)									#Should draw a line in the left top corner of the view port. 
gl.line(0,0,1,0)	
gl.line(0,0,1,-1)
gl.line(0,0,0,-1)
gl.line(0,0,-1,0)
gl.line(0,0,-1,-1)
gl.line(0,0,-1,1)
gl.line(0,0,1,0)
gl.line(0,0,0,1)

gl.finish('test.bmp')	
Ejemplo n.º 4
0
from render import Render

gl = Render()
gl.CreateWindow(9000, 9000)
gl.clearColor(0, 0, 0)
gl.clear()
gl.color(1, 1, 1)
gl.load('./tarea1/Bowl.obj', (40, 40), (40, 40))
gl.finish('Bigmax.bmp')