java3ddictionary2djava-3d

Trying to convert a 2D image into 3D objects in Java


Hey, I'm trying to take a simple image, something like a black background with colored blocks representing walls. I'm trying to figure out how to go about starting on something like this. Do I need to parse the image and look at each pixel or is there an easier way to do it? I'm using Java3D but it doesn't seem to have any sort of built in support for that...


Solution

  • Turns out what I really wanted was a height mapper. I mapped each pixel to a certain height based on its gray-scale RGB value. If I wanted color to be independent of height, I would have two images, one with the gray-scale height map and another with a colored image of what I want the, in this case, room to look like. As for recognizing colors from an image as a specific object other than by pixel, definitely requires something more complex. A friend was suggesting something like painter's algorithm for something like that. However, at least for me, that was being the scope of my application.