|
Author |
Topic: get pixel in 3-dimensional space (Read 345 times) |
|
Anne Guest
|
get pixel in 3-dimensional space
« on: Mar 25th, 2004, 5:44am » |
|
I am trying to find out the color of a pixel in a 3-D image. I saw the get command, but it only has a place for x and y. Is there a way to get the color of a certain coordinate(x,y,z)? The reason I want to do this is because I'm trying to slice through a 3-D shape that I've drawn with processing to get a 2-D image kind of like what happens with a MRI. Please help me!!! Thanks. Anne
|
|
|
|
elout
|
Re: get pixel in 3-dimensional space
« Reply #1 on: Mar 25th, 2004, 4:48pm » |
|
I guess one way to do it would be; creating an array with all the 3D points/colors in them, and reading from them again, if you want to draw something. maybe you know if you have an image[] you can set the points like - image[(y*width)+x] if add another dimension like z, you can do it like - myarray[(z*(width*height))+(y*width)+x] simple example I cooked up quickly; http://www.xs4all.nl/~elout/temm/ (although it`s a bit slow now)
|
|
|
|
Anne Guest
|
Re: get pixel in 3-dimensional space
« Reply #2 on: Mar 26th, 2004, 11:21pm » |
|
The problem is that I don't know the color of each 3-D coordinate since the 3-D image is generated through the program. Does that make sense? Did you already answer this question? Thanks
|
|
|
|
|