kopia lustrzana https://github.com/villares/sketch-a-day
				
				
				
			190409 is not quite there yet...
							rodzic
							
								
									24f851ee88
								
							
						
					
					
						commit
						0406aba21b
					
				
										
											Plik binarny nie jest wyświetlany.
										
									
								
							| 
		 Po Szerokość: | Wysokość: | Rozmiar: 14 KiB  | 
| 
						 | 
					@ -24,8 +24,8 @@ assert len(cd_i) == len(ab_i)  # has to mantain equal number of pts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def setup():
 | 
					def setup():
 | 
				
			||||||
    size(850, 500, P3D)
 | 
					    size(850, 500, P3D)
 | 
				
			||||||
    global cam
 | 
					    # global cam
 | 
				
			||||||
    cam = PeasyCam(this, 300)
 | 
					    # cam = PeasyCam(this, 300)
 | 
				
			||||||
    hint(ENABLE_DEPTH_SORT)
 | 
					    hint(ENABLE_DEPTH_SORT)
 | 
				
			||||||
    smooth(16)
 | 
					    smooth(16)
 | 
				
			||||||
    strokeWeight(2)
 | 
					    strokeWeight(2)
 | 
				
			||||||
| 
						 | 
					@ -37,14 +37,14 @@ def draw():
 | 
				
			||||||
    ab_i[-1] = bh
 | 
					    ab_i[-1] = bh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    background(200)
 | 
					    background(200)
 | 
				
			||||||
    cam.beginHUD()
 | 
					    # cam.beginHUD()
 | 
				
			||||||
    with pushMatrix():
 | 
					    with pushMatrix():
 | 
				
			||||||
        translate(100, 350)
 | 
					        translate(100, 350)
 | 
				
			||||||
        draw_unfolded()
 | 
					        draw_unfolded()
 | 
				
			||||||
    cam.endHUD()
 | 
					    # cam.endHUD()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    with pushMatrix():
 | 
					    with pushMatrix():
 | 
				
			||||||
        # translate(width / 2, height / 2)  # comment out if with PeasyCam
 | 
					        translate(width / 2, height / 2)  # comment out if with PeasyCam
 | 
				
			||||||
        rotateX(QUARTER_PI)
 | 
					        rotateX(QUARTER_PI)
 | 
				
			||||||
        rotateZ(PI)
 | 
					        rotateZ(PI)
 | 
				
			||||||
        translate(-300, -50, -100)
 | 
					        translate(-300, -50, -100)
 | 
				
			||||||
| 
						 | 
					@ -147,9 +147,18 @@ def draw_3d():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for i in range(1, len(ab_pts)):
 | 
					    for i in range(1, len(ab_pts)):
 | 
				
			||||||
        p = i - 1
 | 
					        p = i - 1
 | 
				
			||||||
 | 
					        x = screenX(*cd_pts[::-1][p])
 | 
				
			||||||
 | 
					        y = screenY(*cd_pts[::-1][p])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        triangulated_face(
 | 
					        triangulated_face(
 | 
				
			||||||
            cd_pts[::-1][p], ab_pts[p], ab_pts[i], cd_pts[::-1][i])
 | 
					            cd_pts[::-1][p], ab_pts[p], ab_pts[i], cd_pts[::-1][i])
 | 
				
			||||||
 | 
					    with pushStyle():
 | 
				
			||||||
 | 
					        fill(0)
 | 
				
			||||||
 | 
					        for i in range(len(ab_pts)):
 | 
				
			||||||
 | 
					            text("ab"+str(i), *ab_pts[i])
 | 
				
			||||||
 | 
					        for i in range(len(cd_pts)):
 | 
				
			||||||
 | 
					            text("cd"+str(i), *cd_pts[i])
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
    # diagonal
 | 
					    # diagonal
 | 
				
			||||||
    # stroke(ENG_COLOR)
 | 
					    # stroke(ENG_COLOR)
 | 
				
			||||||
    # line(0, 0, bh, box_w, box_d, dh)
 | 
					    # line(0, 0, bh, box_w, box_d, dh)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Ładowanie…
	
		Reference in New Issue