Skip to main content

3D Pixel to Screen Coordinate

2 replies [Last post]
chambs100
Offline
Joined: 2010-05-07

I'm brand new to Java3D, but I do have an idea of the concepts of 3d transformation to screen coordinates. Here is my problem:

I have loaded a digital elevation model (or terrain in raster format, commonly referred to as a DEM) loaded in as a 2D Array and terrain cover loaded into a 2D array. I would like to transform the terrain cover into a 1024x768 array that would mimic how the scene would look on a monitor. I know the viewing angle, the viewpoint, etc. However, I do NOT need to show the image, it is only used for analysis.

Any ideas? I have tried looking through google docs, but I need a simple example, not just brief comments on what each function does within each class.

The goal is to have a computer algorithm assess what the terrain would look like from a perspective view using a type of pattern analysis. That is why I don't need to see the actual image.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aces
Offline
Joined: 2003-07-17

Not sure if I got it all, but ...

I guess you need to transform the 2D image / DEM data in a 3D surface, where a simple implementation uses x and y are the same of your original image, and Z is the raw value read from pixel at (xi,yi). It's usual to have a correction factor for Z, as vertical scale is usually different for Z axis.

You may don't need the actual image, but you need the 3D representation of it.

There are some algorithms to optimize this kind of surface, collapsing neighbor quads/ triangle with same Normal, but this is another subject.

chambs100
Offline
Joined: 2010-05-07

Sure, just to clarify...

The DEM is a 2D image (more specifically a 2.5D), with elevation values stored as a pixel's grayscale value. So, I take that value and store it directly into a 2D array. I also have terrain cover as a 2D array, say for example places with grass and places with dirt.

I would like to transform those data into a perspective view, to something like this (but without the trees): http://homepages.inf.ed.ac.uk/s0094060/panda3d/scrot2.png

The image you see is roughly 800x600. So, each pixel on the image actually represents part of the original terrain data.

Ultimately what I want is not a picture on the screen, but a new array of size 1024x768 (simulating a screen) telling me where grass and where dirt is located on the terrain in perspective view.

Does that help? I can clarify more!