Code Monkey home page Code Monkey logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
first try to read the pixels after creating the scene, so after all the objects 
are traversed. so just put it at the end of the draw method. and the difficult 
part will be to merge the opengl bitmap with the camera image;)

maybe you should move your code to a seperate class otherwise you might get 
problems when the renderer class is changed.

Original comment by simon.heinen on 22 Sep 2011 at 3:19

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
Hi Simon,

Thank you for your answer. Actually my first attempt was putting the code at 
the end of the onDrawFrame method --> same result.

Do you mean that the the opengl bitmap is an overlay above the camera view? I 
thought you were merging all those elements... (it explains my black image).

Original comment by [email protected] on 22 Sep 2011 at 3:38

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
jep they are two separate overlays (the camerapreview and the opengl surface 
view) so currently you are only getting the information from the opengl view. 

im using glReadPixel in a similar way in the ObjectPicker ( 
http://code.google.com/p/droidar/source/browse/trunk/droidar/DroidAR/src/gl/Obje
ctPicker.java ) class:

                ByteBuffer pixelBuffer = ByteBuffer.allocateDirect(4);
                pixelBuffer.order(ByteOrder.nativeOrder());
                gl.glReadPixels(x, y, 1, 1, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE,
                                pixelBuffer);
                byte b[] = new byte[4];
                pixelBuffer.get(b);

so it should be possible to read all pixels on the screen this way (im not sure 
if its the best way, sounds a little inefficient;). just make sure that you do 
this after rendering all the objects in the elementsToRender list

the merging with the camera preview should be possible to if you write some 
little helper methods to manage the transparency in the opengl view. i'm 
currently busy learning for 2 exams but i should have some time in about one 
week, you can post your progress here till then.

Original comment by simon.heinen on 22 Sep 2011 at 6:21

  • Changed state: Accepted

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
Thanks simon! Actually I also quite busy right now, but I'll try to have a look 
at it later. I'll keep you posted!

Original comment by [email protected] on 23 Sep 2011 at 7:57

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
have this been successful? thank you I also want to capture an image with the 
openGL bitmaps

Original comment by [email protected] on 3 Oct 2012 at 2:56

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
this framework is so nice,but i can't use it taking pictures.who can help me?

Original comment by [email protected] on 6 Nov 2014 at 1:58

from droidar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.