Search code examples
algorithmgraphics2draytracing

How to convert a picture into different view by the test position using ray tracing


Now I want train a path loss model, and I have a map picture, and I want to convert this map into different views by the test location(x,y)

I need a conversion algorithm to produce a lot different map views by the test location.Now I can show a example of this(I am sorry this hard to describe)

in the left up is the map with 4 column,in the right bottom is the convert-new-map:

img

I want to use some "light resource"(the location A) to project onto the building in the map, then some light will be blocked, then we will get the shadow in this test location.

so the shadow from the AP location and test location can present the environment information in this area.

If you have some idea to solve this, please let me know. Thanks in advance

Cheng Hong

After discussing and googling, I find out that I should using some ray tracing technology for a 2D map.

In my research, I have two point, location A and location P in a map. And now I want to use ray tracing to convert the map combining the two locations into a new map view. In this new map view, the location A point is in the center, then some shadow will be added resulting from the building(call it black column) in the origin map. Then this new map is a kind of presentation or describer for the map and two location point. That is what I want to do.


Solution

  • you need to add more specs like the map is an raster image or vector? This has nothing to do with conversion (hence the retag) you just want to render your 2D map as 3D scene or its 2D slice (single horizontal line) this can be done really easily.

    1. raster map

      google Wolfenstein ray casting rendering techniques like:

    2. vector map

      construct mesh from your map and render by any 3D gfx api like OpenGL. To get started with this approach you need to grasp this:

      see also the sub-links in there ...

    To implement the lighting condition you can implement any kind of shading. The easiest is normal shading. For more info see: