Subject:
|
Re: The World according to Harshbarger, Lambrecht, and Lowell
|
Newsgroups:
|
lugnet.build.sculpture
|
Date:
|
Tue, 22 Nov 2005 08:07:15 GMT
|
Viewed:
|
5034 times
|
| |
| |
In lugnet.build.sculpture, Bram Lambrecht wrote:
|
In lugnet.build.sculpture, David Winkler wrote:
|
I saw this and thought it was the greatest thing ever. I did my own virtual
version with
instructions.
Plate Lowell Globe
I followed Mr. Harshbargers lead and based it on a 48 stud diameter Lowell
Sphere. The land masses come from the
Etopo5 database provided
by the NOAA.
|
Would you mind sharing what software or code you used to map the image to the
sphere? Im wondering how the globe would look with
one of these images
mapped to the Lego palette. --Bram
|
The mapping from these images to a sphere is a conversion to Ldraw coordinates,
then a rotation based on which panel we are rendering, then a conversion from
these to polar coordinates, then interpreting phi to be latitude, and theta to
be longitude. (Or vice versa, I always get them confused.) The polar
coordinate equations are in most calculus books.
My mapping is hand rolled code, generally as follows:
foreach iX, iY, iZ
int iDiameter = 20 * 48;
double drx, dry, drz;
{
double fx, fy, fz;
fx = 20 * (iX - 0.5 * (iMaxX - iMinX)); fy = 20 * (iY - 0.5 * (iMaxY - iMinY)); fz = (iDiameter / 2) + 8 * (iZ - iMaxZ);
switch (byteOnPanel)
{
default:
case 0:
drx = -fx;
dry = fy;
drz = -fz;
break;
case 1:
drx = fx;
dry = fy;
drz = fz;
break;
case 2:
drx = -fz;
dry = fx;
drz = -fy;
break;
case 3:
drx = fz;
dry = -fx;
drz = -fy;
break;
case 4:
drx = -fy;
dry = -fz;
drz = fx;
break;
case 5:
drx = fy;
dry = fz;
drz = fx;
break;
}
}
double fr = Math.Sqrt(sqr(drx) + sqr(dry) + sqr(drz));
double fp = Math.Atan2(drz, Math.Sqrt(sqr(drx) + sqr(dry)));
double ft = Math.Atan2(dry, drx);
double px = (ft + Math.PI) / (2 * Math.PI);
double py = (fp + 0.5 * Math.PI) / Math.PI;
System.Diagnostics.Debug.Assert((px >= 0) && (px <= 1));
System.Diagnostics.Debug.Assert((py >= 0) && (py <= 1));
int iEtopoX = (int)(imageWidth* px);
int iEtopoY = (int)(imageHeight* py);
int iE = aiElevationData[(iEtopoY * imageWidth) + iEtopoX];
Then place a blue plate if iE is less than 0 (below sea level) and a green plate
if iE is greater than or equal to 0 (at or above sea level).
The results of this are then fed into the filling software (described in the
bunny document).
|
|
Message has 1 Reply:
Message is in Reply To:
14 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|