|
Author |
Topic: getting pixel values of z axis (Read 626 times) |
|
ether
|
getting pixel values of z axis
« on: Oct 27th, 2003, 1:54pm » |
|
Dear all, Would anyone have any idea how to get the RGB values of the pixels in z axis? Built-in method "get()" takes only x and y as its parameters... Thank you for your time & help in advance ether
|
|
|
|
Koenie
|
Re: getting pixel values of z axis
« Reply #1 on: Oct 27th, 2003, 6:37pm » |
|
Most peoples screens are two dimensional.
|
http://koeniedesign.com
|
|
|
Martin
|
Re: getting pixel values of z axis
« Reply #2 on: Oct 28th, 2003, 4:16am » |
|
ether, get() takes the pixel value from pixels[]. being a one dimensional array constrained by width and height, it can only return an output from one or two inputs. however, it would be possible to get the pixel value of a translated object by integrating the translation into the two inputs. take note though that there could be shading that goes on so it might not return the correct value.
|
|
|
|
toxi
|
Re: getting pixel values of z axis
« Reply #3 on: Oct 28th, 2003, 9:44am » |
|
you could use screenX() & screenY() to get the transformed 3d->2d coordinates of the point, then use get to retrieve the colour of its pixel: Code:int getAtXYZ(float x, float y, float z) { return get(screenX(x,y,z),screenY(x,y,z)); } |
| only problem is, that while it's a possible solution, it won't work for a many cases, as an object might not be even drawn on screen in the 1st place, if it's behind another one. so this will only work in specific situations.
|
http://toxi.co.uk/
|
|
|
Martin
|
Re: getting pixel values of z axis
« Reply #4 on: Nov 2nd, 2003, 2:31pm » |
|
well said toxi.
|
|
|
|
|