#VRML V2.0 utf8 # Lab #1 ################################################### # Name: Phuc Nguyen # SID: 13547274 # Login: cs184-dh # Section: 103 ################################################### Group { children [ # Define and draw two letters P & N on the center of the original coordinate DEF initials Group { children [ DEF LetterP Shape { # define letter P appearance Appearance { material Material {diffuseColor 0.0 1.0 0.0 } } geometry IndexedFaceSet { coord Coordinate { point [ -4.8 -1.6 0.0 -4.1 -1.6 0.0 -2.8 0.8 0.0 -2.0 0.0 0.0 -1.0 1.8 0.0 -3.0 1.8 0.0 -2.6 1.4 0.0 -1.8 1.4 0.0 -2.1 0.9 0.0 ] # end the list of points for P } coordIndex [ # connect points CCW 0, 1, 2, 3, 4, 5, 0 6, 7, 8, 6] # draw the hole inside the letter convex FALSE } }, # done with letter P DEF LetterN Shape { # define letter N appearance Appearance { material Material {diffuseColor 0.9 0.5 0.0 } } geometry IndexedFaceSet { coord Coordinate { point [ -0.8 -1.6 0.0 0.8 -1.6 0.0 1.0 -1.2 0.0 0.4 -0.6 0.0 0.6 -0.2 0.0 2.0 -1.6 0.0 3.6 1.8 0.0 2.0 1.8 0.0 1.85 1.65 0.0 2.4 1.2 0.0 2.2 0.8 0.0 1.0 1.8 0.0 ] } coordIndex [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0 ] convex FALSE } # done with letter N } ] }, # end Def. of the two letters. # Define the upper line : PN PN PN PN PN PN PN from the original letters # with the scales given DEF Above Group { children [ DEF upperleft Group { # define three pairs of letters (PN PN PN) # upperleft conner children [ Transform { translation -6.8 3.5 0.0 children DEF ScaledInitials Transform { scale 0.2 0.2 1.0 children USE initials } }, Transform { translation -4.6 3.5 0.0 children USE ScaledInitials }, Transform { translation -2.4 3.5 0.0 children USE ScaledInitials } ] } , # end upperleft Transform { # Define the middle pair PN translation 0.0 3.5 0.0 children USE ScaledInitials }, Transform { # Define upper right three pairs (PN PN PN) # by translating the upperleft group translation 9.2 0.0 0.0 children USE upperleft } ] }, # end upper line # Define & draw the bottom line by rotating the upper line by 180 degrees # about Z axis Transform { rotation 0.0 0.0 1.0 3.142 children USE Above } # Define the left column by rotating the upper left group about the Z axis DEF LeftColumn Transform { translation -4.6 4.6 0.0 # translate the parent coordinate rotation 0.0 0.0 1.0 1.571 # rotate CCW 90 degree #center -5.7 3.6 0.0 children USE upperleft } # Define the right column by rotating the left column 180 degrees CCW. Transform { rotation 0.0 0.0 1.0 3.142 children USE LeftColumn } ] } # end text