Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a 3D array representing a 3D object (x,y,z). The values stored in the array are RGB colors. Is it possible to generate an image of the object from any given point of view?
That is certainly possible. The keywords here are transformation and projection, basically you define a point for every (3D) Pixel inside your array. Then you multiply all the points with a bunch of matrices and get a 2-dimensional result.
Here is an article about how OpenGL does it's transformations:
http://www.songho.ca/opengl/gl_projectionmatrix.html
You could mimic the whole pipeline in C++ to produce a bitmap on your CPU or use OpenGL directly which would be a thousand times faster. When using OpenGL you could also view your model in realtime from all sides, but that would essentially be a full 3D-Application.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am asked to create a program as following..
"create random polygons, the point
when you press the mouse button is considered like a nail in the polygon. You can drag the polygon
with the mouse and place it somewhere on the wall. When you release the mouse button,
the polygon rotates around the nail in order to simulate the pulling of the gravity
You are not allowed to use methods from java (like AffineTransform). "
so far I managed to create random polygons, add a "nail", and drag the shapem but I can't seem to find a way to rotate it , can I -sort of- Transform it ?
One alternative to using an AffineTransform is to use geometry to calculate the new polygon.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to do my own program and what the basis of what I want is to use some sort of slider to take characters to different buildings. I essentially have a one long vertical road with my bus (which is what the slider will be). I know the general icon for a JSlider is a small pentagon that can be dragged to different values. I was just wondering, is there a way to change that pentagon icon into something of my choice?
You'll need to extend the BasicSliderUI and override paintThumb() to render the desired Shape. This example renders a triangle using drawLine().
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I apologize if this is the wrong place to ask - please let me know if it is, and I will remove this post.
My question is - are there any Java graphic libraries that can take RGB values as inputs and maps those onto a graph? I have been looking at JFreeChart, and a number of the open source solutions, but looking at the documentation, I haven't been having much luck.
Currently, I have a multi-dimensional array that stores 1302 RGB values, which corresponds to 93 rows and 14 columns. As each "index" stores a RGB string in this format i.e. 0,0,0 I hope to graph each individual color into a x-y graph such as like this:
In the above graph, the black is a 0,0,0 value, while the cyan, green, red, etc, are all their individual RGB values.
Since you're asking about plotting heat maps, the answer is yes. Many, in fact, but one such library is jHeatChart over at http://tc33.org/projects/jheatchart
Note that just because your values are encoded as "RGB Strings" doesn't mean you want to ask about using RGB strings, you want to ask about plotting temperature values. The fact that they're RGB strings is irrelevant since we can transform them however we need to make them suitable input.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Could you point me in the right direction to find a tutorial on how to convert a grayscale image to it's original colors? Is this even possible?
I've tried using BufferedImage and applying a function to the RGB values by bitshifting them 8 bits to the left and isolating the reds, but, of course, there are no reds that are found, as it is grayscale.
I'd really appreciate a push in the right direction!
"Is this even possible?" -- No, not a prayer's chance in Hades. Once you have a grayscale image, all color information is gone.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to do some image processing on a coloured image and for me to do so I need to separate the RGB values and modify them separately. I am just implementing a increase in brightness filter. I am doing this in java. Can someone help me out please
You have a few options.
First, you need to be able to load an image that supports the BufferedImage class. For this, you're best using the ImageIO API. Take a look at Reading/Loading an Image.
Once you have this, you can obtain the pixel information in a verity of ways.
One of the simplest is to use BufferedImage#getRGB, which returns a packed integer of the pixel.
Depending on the type of image, you can obtain the individual color values Color(int, boolean), which will unpack the integer accordingly (you can also do this manually, but I never remember the maths and this is simpler).
Alternativly, you can access the Raster directly, via BufferedImage#getData, which provides you access to more methods for manipulating the underlying pixel information (such as grabbing regions of pixels for example)
Now, if all that sounds like more fun then you can handle, you can easily perform image brightening using a BufferedImageOp...
See, Adjust brightness and contrast of BufferedImage in Java and How to change the contrast and brightness of an image stored as pixel values and Change brightness of image using RescaleOp for examples (these where just the top few that popped up on Google)