POV-Ray : Newsgroups : povray.advanced-users : Matrix transform help plz : Re: Matrix transform help plz Server Time
15 May 2021 20:36:41 EDT (-0400)
  Re: Matrix transform help plz  
From: Tor Olav Kristensen
Date: 25 Apr 2021 11:10:00
Message: <web.6085855a14ed78c78e52cc8789db30a9@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> I have some normal text I would like to skew so that its edges align to
> an isometric grid.
>

> from the horizontal screen edge.
>

>
> Would appreciate some help. Here is what I have so far:
>
> matrix
> <
> +1, +0, +0,
> +1, +1, +0,
> +0, +0, +1,
> +0, +0, +0
>  >
> rotate -z * atand(1/2)
>
> It is close but no cigar. Thanks!

Hi Mike

You can try this:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.7;

#include "colors.inc"

global_settings { assumed_gamma 1.0 }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Box =
    box {
        -<1, 1, 1>, +<1, 1, 1>
        translate <-1, -1, +1>
        pigment { color (White + Blue)/2 }
    }

#declare Text =
    text {
        ttf "timrom.ttf" "POV-Ray..." 1, 0
        pigment { color (White + Red)/2 }
    }

// For aligning to an isometric perspective grid
// often used in computer generated graphics
#declare Skew =
    transform {
        matrix <
            +1.0, -0.5,  0.0,
            +2.0, +1.0,  0.0,
             0.0,  0.0, +1.0,
             0.0,  0.0,  0.0
        >
    }

object {
    Box
    transform { Skew }
}

object {
    Text
    transform { Skew }
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

light_source {
    -100*z
    color White
}

camera {
    orthographic
    location -z
    right image_width/image_height*x
    up y
    direction z
    scale 10*<1, 1, 1>
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.