Search code examples
actionscript-3away3d

Checking pixel color value of a 3D object


I have a spinning sphere, built using the away3D engine, it is wrapped in a bitmap. I need to be able to check the color value of the pixels in the sphere, however BitmapData only plots the 2D image, not the 3D sphere. So, the values become wrong. If I try to apply it to the sphere I get nasty errors. I have literally been stuck on this for days. How can I do this?

Any help is greatly appreciated.


Solution

  • Try View3D.renderer.queueSnapshot() But if you pull whole scene snapshot from GPU each frame it will kill performance. So if you need only one pixel you better query it perpixel. And if you need this to do some 2D graphics or user interface you better use Starling because it is GPU side framework so you wont need to pull data back to CPU. Here is integration tutorial.