POV-Ray : Newsgroups : povray.advanced-users : Matrix transform help plz Server Time
30 Dec 2024 12:58:51 EST (-0500)
  Matrix transform help plz (Message 1 to 7 of 7)  
From: Mike Horvath
Subject: Matrix transform help plz
Date: 25 Apr 2021 03:02:51
Message: <6085141b$1@news.povray.org>
I have some normal text I would like to skew so that its edges align to 
an isometric grid.

That is, the vertical and horizontal edges should be rotated 26.565° 
from the horizontal screen edge.

26.565° = atan(1/2)

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!


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Matrix transform help plz
Date: 25 Apr 2021 10:05:00
Message: <web.608576f214ed78c71f9dae3025979125@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.

Which one?


> from the horizontal screen edge.

Without a diagram, that's confusing.


When I grab a random isometric grid from the web, I put it as a background, and
it looks like I get 3 x-units to every 2 pov units for the new y' vector, and
it's half the height (angle of 36.87 deg)

That gets me a second row for the transform matrix of 2/3, 0.5, 0.
(magenta vector)

But that's as far as I can get without exact parameters.

You have a matrix transform AND a rotation - so maybe you need something
different than what I'm showing?


Post a reply to this message


Attachments:
Download 'matrixtransformtext.png' (398 KB)

Preview of image 'matrixtransformtext.png'
matrixtransformtext.png


 

From: Tor Olav Kristensen
Subject: Re: Matrix transform help plz
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

From: Tor Olav Kristensen
Subject: Re: Matrix transform help plz
Date: 25 Apr 2021 11:20:00
Message: <web.608587d514ed78c78e52cc8789db30a9@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> 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.
>
> Which one?
>
>
> > from the horizontal screen edge.
>
> Without a diagram, that's confusing.
>...

Bill,

Here's some information about the grid that Mike seems to be using:

https://en.wikipedia.org/wiki/Isometric_video_game_graphics

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


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Matrix transform help plz
Date: 25 Apr 2021 11:40:00
Message: <web.60858cf414ed78c78e52cc8789db30a9@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
>...
> Hi Mike
>
> You can try this:
>...

Also try this:

#for (Angle, 0, 270, 90)
    object {
        Text
        translate 0.2*x
        rotate Angle*z
        transform { Skew }
    }
#end // for

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


Post a reply to this message

From: Mike Horvath
Subject: Re: Matrix transform help plz
Date: 28 Apr 2021 12:39:28
Message: <60898fc0$1@news.povray.org>
On 4/25/2021 11:06 AM, Tor Olav Kristensen wrote:
> // 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
>          >
>      }


Perfect! Thank you!

With a little trig maybe I can skew in an arbitrary direction?

We'll see...


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Matrix transform help plz
Date: 28 Apr 2021 12:40:32
Message: <60899000$1@news.povray.org>
On 4/25/2021 11:16 AM, Tor Olav Kristensen wrote:
> Bill,
> 
> Here's some information about the grid that Mike seems to be using:
> 
> https://en.wikipedia.org/wiki/Isometric_video_game_graphics
> 
> --
> Tor Olav
> http://subcube.com
> https://github.com/t-o-k
> 
> 

Yes! In fact, I created about half of those illustrations.


Mike


Post a reply to this message

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