Excellent 3D Monsters


  • admin

    0_1515706161344_monsterMovie.png

    By skewing text a couple of degrees forwards or backwards you can give the impression of perspective. But it's not very subtle.

    size(1000, 1000)
    
    theText = [u"EXCELLENT", "MONSTER", "MOVIES"]
    font("HelveticaNeue-CondensedBlack")
    s = 164    # fontsize
    lp = -136    # linespacing
    fontSize(s)
    
    translate(122,590)
    
    # these are the skew angles.
    # protip: select value, command + drag = change value
    leftSlant = -27
    rightSlant = 46
    angle = [leftSlant, rightSlant]
    
    # these values are the tracking of the even / odd lines
    leftTrack = 105 *0.1
    rightTrack = 40 *0.1
    tracks = [leftTrack, rightTrack]
    
    def ip(f, a, b):
        return a+f*(b-a)
    
    for i, theLine in enumerate(theText):    
        wordWidth, textHeight = textSize(theLine )
        sofarWidth = 0
        thisTrack = tracks[i%2]
        for c in theLine:
            thisAngle = angle[i%2]
            letterWidth, textHeight = textSize(c )
            factor = (len(theLine)*thisTrack+sofarWidth+.5*letterWidth)/wordWidth
            save()
            # some alternative skew transforms
            skew(ip(factor, -thisAngle, thisAngle), 0)
            text(c, (0, 0))
            restore()
            translate(letterWidth+thisTrack,0)
            sofarWidth += letterWidth
        translate(-wordWidth-len(theLine)*thisTrack,lp)
    
    saveImage("monsterMovie.png")
    

Log in to reply