POV-Ray : Newsgroups : povray.newusers : Can I do an Axonometric projection? (primitive game style isometric(ish) projection) Server Time
1 Nov 2024 21:22:42 EDT (-0400)
  Can I do an Axonometric projection? (primitive game style isometric(ish) projection) (Message 1 to 3 of 3)  
From: Martin
Subject: Can I do an Axonometric projection? (primitive game style isometric(ish) projection)
Date: 23 Dec 2004 10:04:11
Message: <41cade6b$1@news.povray.org>
Rather hard to describe in words but..

Has anyone got POV to render images in the false isometric view where 
the x and y-axes of the (3-dimensional) world space are projected to x 
and y in the scene and z is mapped to a diagonal line
y    z
|   /	
|  /
| /
|/
----------x

I want to display a map and instead of just displaying it flat I wanted 
a pretty rendered 3D view but without any perspective issues.
The map is retangular and so I want its sides parallel and the top and 
botom to be horizontal, is this too perverse for POV ray?

I can get fairly close with an orthographic projection but then I have 
to shear the image externally to make the nearside of the map horizontal.


Post a reply to this message

From: Slime
Subject: Re: Can I do an Axonometric projection? (primitive game style isometric(ish) projection)
Date: 23 Dec 2004 14:28:15
Message: <41cb1c4f@news.povray.org>
> I can get fairly close with an orthographic projection but then I have
> to shear the image externally to make the nearside of the map horizontal.

Orthographic is the way to go, but to get the effect you're looking for,
you'll have to shear the *camera*.

Start with a camera looking straight at the X-Y axes (I'm assuming
left-handed coordinates here so the Z axis is pointing away):

camera {
    orthographic
    location -z
    right x*mapwidth/2
    up y*mapheight/2
    look_at 0


With this camera, the Z axis will be pointing straight away from the camera.
To make it point kind of diagonally, we can use a simple matrix
transformation:

    matrix <
        1,0,0,
        0,1,0,
        -xamnt,-yamnt,1,
        0,0,0
    >
}

where xamnt and yamnt are the amounts that the z axis points in the x and y
directions. To match up with your picture, try xamnt = .3 and yamnt = .8.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Martin
Subject: Re: Can I do an Axonometric projection? (primitive game style isometric(ish) projection)
Date: 24 Dec 2004 05:16:05
Message: <41cbec65$1@news.povray.org>
Slime wrote:
> Orthographic is the way to go, but to get the effect you're looking for,
> you'll have to shear the *camera*.

Thanks that works fine - obvious in hindsight and once you know matrix 
transforms are legit on the camera (as long as you don't have vista 
buffers - which I don't need but had for some legacy reason).

The end result is a rather odd optical illusion when you use it on a 
chequered plane, the squares further away look larger and the right side 
of the map looks more sloped.

I'm now playing with the matrix transform on perspective cameras, so 
I've now got many options for displaying the map :-)

thanks again
		Martin


Post a reply to this message

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