POV-Ray : Newsgroups : povray.advanced-users : how can a square mesh be changed to a rhomboid : Re: how can a square mesh be changed to a rhomboid Server Time
1 Jul 2024 05:41:39 EDT (-0400)
  Re: how can a square mesh be changed to a rhomboid  
From: davidafisher
Date: 15 Aug 2010 16:10:00
Message: <web.4c68497ba72b83ae6175cda10@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> > I have a DTM (digital terrain Map) which is square, a mesh comprising of 140,000
> > smooth triangles. I need to adjust the map for convergence - difference of the
> > grids north to the earths true north. The adjustment would result in a rhomboid
> > where the top-left corner might be rotated by, say 3 degrees from the
> > bottom-left corner and the top-right corner rotated by 2 degress from the
> > bottom-right corner.
> >
> > Does anybody have an idea on whether this can be achieved in POV-Ray?
> >
> >
>
> Normaly, for most maps, the sides are parallel to the local longitude,
> and the top and bottom are parallel to the local latitude.
>
> If I read correctly, you don't realy want a rhomboid but a trapezoid or
> something close to that. (top and bottom sides are parallel, but the
> sides are NOT parallel)


> Furthermore, the sides don't seems to stay straight, but somewhat curves
> out on the sides and bottom, and curven IN for the top.
>
> What I think you /realy/ want is to treat the DTM as a
> longitude/latitude object and map it on a sphere, keeping the sides
> parallel to the latitude and longitude lines of the sphere.
>
> If I'm right, then, the other answers are not what you need. You need a
> spherical transformation of every vertex of the mesh. Then, most
> straight lines traced on the map will become curves.
>
> It can be done, but involve much more work than a simple matrix
> operation. You need to scan the raw mesh array using loops and transform
> every point individualy from rectangular coordinated to spherical
> coordinates.
>
>
>
> Alain

The matrix sugestion did put me on the right track! but Alain, you are correct,
parsing every tringle is what would need to be done, and I believe I have the
resolution.

the vertices of the triangles in the map are given in easting and northing.
I have to convert these eastings and northings to geocentric cartesian xyz
points.

There doesn't seem to be a single step conversion to do this so a a two step
process has to be employed. First converting the eastings and northings to
latitude & longitude and then convert the Lat longs to the cartesian xyz.

But this raises an issue. The triangles will be "distorted" from their original
shape - if this impacts the normals to the vertices I don't know how to deal
with that.


Post a reply to this message

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