Android :: OpenGL ES - Color Picking - Front/Back Buffer

Sep 2, 2010

I have a 3D game and I am using color-picking to know which object was selected.

When the user touches the screen, I draw each object with a different color. Then I read the color where the user touched the screen to know which object was selected. After that I draw each object with their respective textures/colors. (everything done during one onDrawFrame pass)

The problem is that sometimes the colored objects appear on the screen (~5% of the times the user touches the screen) and it is even worse on slower hardwares.

This is my pseudo code:

CODE:...........................

Android :: OpenGL ES - Color Picking - Front/Back Buffer


Android :: Opengl Es Color Picking On Android Without Screen Flashing

May 3, 2010

I have written a object selection algorithm which picks the objects by their color. i give every object an unique color and then i just have to use the glReadPixels method to check which object was selected

this works fine and is really fast but the problem is that the frame is displayed on the screen with all the picking-colors so the screen flashes every time you select something.

so my question is: how do i write everything in the correct display buffer but dont display it on the screen to avoid these flashes?

View 3 Replies View Related

Android :: OpenGL Depth Buffer - Cant Get To Work

Apr 29, 2010

I'm currently learning OpenGL ES programming on Android (2.1). I started with the obligatory rotating cube. It's rotating fine but I can't get the depth buffer to work. The polygons are always displayed in the order the GL commands render them. I do this during initialization of GL:

CODE:...........

On surface-change I do this:

CODE:............

When I enable backface culling then everything looks correct. But backface culling is only a speed-optimization so it should also work with only the depth buffer or not? So what is missing here?

View 2 Replies View Related

Android :: Getting OpenGL-ES Stencil Buffer Working

Jun 29, 2010

With the stencil buffer in opengl-es for Android, I'm simply trying to mask out drawing part of the screen. I think I have it set up right, but it is not masking out the non-stenciled parts. Below is an extraction of code for what I'm doing.

CODE:......

I have confirmed this draws to the correct location by allowing colour to show. Trust that this draws the mask to the correct location.

CODE:.......

Draw everything. Only items inside the masked area should be drawn. But everything is drawn with this code...

CODE:.................

Anyone spot anything wrong with this? What it does basically is draw a box for say, half the screen (this works if I had colour enabled) which is setting the stencil buffer to 1 for that area. And at the end I draw to the whole screen. I want it to draw to the top half only, but it draws everything.

View 1 Replies View Related

Android : Opengl Direct/NonDirect Buffer

Aug 4, 2010

Been getting a headache with some 2d Opengl coordinates and putting them in a direct buffer.

I have a basic square defined as such

CODE:...............

This runs, no segfault or anything, and when I iterate through the buffer the size and values seem exactly the same (8 elements, ordered just as the array). What happens though is that my draw() function draws nothing, it works one way, but doesn't work the other way. I use Direct Buffers in a lot of my other geometry. I have to get direct buffers working or I know that my software might not be reliable.

CODE:.........

My Drawing function is as follows.

CODE:..................

View 2 Replies View Related

Android : Use An Index Buffer With A Texture In OpenGL ES?

Sep 21, 2009

I'm using OpenGL ES to display some objects exported from Blender. Blender provides a list of vertices, a list of the face indices and a list of the 2d texture co-ordinates. Within Blender, and I believe generally in OpenGL, the texture co-ordinates map to each vertex described in the index array.

I suppose I have two questions:

I'm given to understand(see the "Applying Textures" section) that in OpenGL ES the texture co-ordinates map to the vertex buffer only, not the index buffer. Is this the case or is there a way of binding the texture co-ords to the index buffer instead?
If the above is true, is there anything to be gained from using an index buffer at all? After all to properly map the textures one will need to write out the vertex buffer with all the redundancy that would have been saved with the index buffer. Is there still a performance increase to be gained or are index buffers redundant for textured data?

View 1 Replies View Related

Android :: Bitmaps And Out Of Memory Error (Allocating Back Buffer)

Sep 2, 2010

We are also having occasional problems with OutOfMemory errors in createBitmap. It tends to happen after a few orientation changes when we are allocating the backbuffers. I have made it so that it calls recycle() on the old bitmaps (if any exist) and does a System.gc() before allocating the new backbuffers. What we are doing is allocating a backbuffer that is twice the width and height of the screen so that we can quickly zoom in and out.

With a 854x480 screen this would presumably be 6.25MB in size. The problem as I see it is the 16 or 24MB maximum heap size per process. This is unreasonably small, especially on devices that have 512MB of RAM. Ideally the max heap size should be something like 64MB, or perhaps allow apps to request a larger heap size from the user.

View 14 Replies View Related

Android : How Do I Set Color Back To "Color.BLACK" After User Releases Touchscreen

Mar 27, 2010

I'm programming my first Android application and I've stumbled over a little problem.

I've created my own adapter ("extends BaseAdapter") for my ListView and in my "public View getView(...)" I have the following code:

My problem: How do I set the color back to "Color.BLACK" after the user releases the touchscreen?

I'm looking for something that is similar to Javascripts "onMouseUp" or "onKeyUp" methods. An OnClickReleaseListener() perhaps?

Can you point me in the right direction?

View 3 Replies View Related

HTC Legend :: HTC Contacts Back To Front

Jul 13, 2010

When I exported my contacts from the Sim card they come in back to front. It's a minor problem but a bit annoying. So all my contacts start with surname then first name. Is there any way I can resolve this.

View 2 Replies View Related

Samsung Fascinate :: How Can I Shift Camera From Back To Front?

Sep 28, 2010

I just picked up a Fascinate. and It has a front facing camera. how can i shift it from back to front? I googled it but it says there is a selfshot mode but mine doesn't have it

View 5 Replies View Related

General :: Using Dual Camera (Front And Back) At Same Time?

Apr 19, 2013

Would there ever be a camera that could use front and back cameras at the same time? Or app? Do it have to be a powerful phone maybe like note 2 ect? Do you think such feature can be run on a low end phone maybe like HTC evo 4g?

I know gs4 can do this but what about other non Samsung phones?

PG86100

View 3 Replies View Related

Motorola Droid :: Zagg Invisible Shield Front And Back

Nov 20, 2009

Thinking about getting the zagg invisible shield front and back. I'm wondering how you guys like it. Particulary interested in how you guys like it with the back shield.

View 2 Replies View Related

Motorola Droid :: Docking Cradle - Cant Plug From Front Of Nightstand Halfway Down Back

Nov 18, 2009

Just got my backorder in. It's nice, but jeez moto a 3 ft USB cable... You cant even get the plug from the front of the nightstand halfway down the back.

View 2 Replies View Related

Android :: How To Connect Features / Get Back Color Effect?

Jun 23, 2010

I wrote application which uses ListActivity. Each item of the list consists of ImageView and TextView. Long click on list entry triggers some menu and color effect because onCreateContextMenu was overridden. Sometimes TextView contains HTML links which I would like to be interactive. I read #1697908 and made links active, so browser/youtube player is started. Everything would be great but color effect on long click disappeared (context menu still appears). Could somebody tell me how to connect these two features and get back color effect?

View 3 Replies View Related

Android :: OpenGL Speed Issue - Code Contribution To Other OpenGL

Feb 25, 2009

Single Threaded OpenGL game ! (check bottom, you can download and use the helper class) Lighting disabled ! Depth Buffer disabled ! Culling enabled ! Textures disabled !

Just 176 integers (x,y values only) making 88 vertexes along with 132 index numbers making "44 triangles only"

Framerates I get is

with GL_BLENDING disabled - 145 fps approx only! enabled - 110 fps approx only!

I have the screenshot of exact code in the draw function here.. just 2 damn lines ! I have hidden only the comments.. click here to see it http://prasna991.googlepages.com/drawframe.png

variable details in the 2 lines of code =========================== ipts = 176 elements (only x and y for each vertex) totallinetriangles * 3 = 176 lineindexes = 132 elements - type "short"

Here is the screenshot of output drawing and how it will look like http://prasna991.googlepages.com/screen.png

OpenGL single threaded Initialization Helper ================================ Here is my OpenGL helper class.. makes the OpenGL initialization for newbies a cakewalk http://prasna991.googlepages.com/OpenGLHelperclass.txt

I tested by rendering on the touch event only.. frame rate drops only when u touch and drag and here I have just tested by tapping and releasing gently on the emulator and on the device

Is this the device limitations ? So graphics is actually a lot lot lot slower than on iPhone ?

View 8 Replies View Related

Android :: NDK OpenGL - Mixing Java And Native - C - Calls To OpenGL API

Jul 24, 2010

I would like to be able to use the OpenGL API from both Java and C (via NDK).

In Java, there is a GL object passed, which has all GL methods on it.

In C, you just talk to the native library.

In a single onDrawFrame callback (for which Java is passed a GL), can I use methods on the GL object, and also call NDK methods which access the openGL library?

In other words, is the GL object just a wrapper for the same instance of the native library?

View 3 Replies View Related

Sony Ericsson Xperia X10 : Way To Change Back Ground Color?

Sep 5, 2010

please can you tell me if you can change the background color of screen from blue? Ive looked all over the phone settings and cant see how to do it can someone please advise me?

View 3 Replies View Related

Android :: Picking An Image For Wallpaper

Sep 4, 2010

I'm writing a live wallpaper and need some help. My wallpaper will create an effect over top of another image or existing wallpaper (not another live wallpaper) that the user chooses in the "Settings".My problem is this: I can't find a way to list the static wallpapers or images on the phone. I've seen some examples of getting the camera images, but not the wallpapers.

View 1 Replies View Related

Android : Picking Up A PhoneBook Entry Under 2.0

Nov 1, 2009

The party is over and Google suddenly released the much anticipated Android 2.0 SDK.

Much improvement for sure !

That said, the party is over and I came to have to deal with the following Ghost;

I've released an app in the market (Ambu) - so far qualified under SDK 1.5 &1.6. Using the emulator for Android 2.0, things don't work anymore.

This is what I'd like to share;

- my app invokes an ACTION.PICK intent as way to extract phone contact from the phone book and populate a database.

When compiling my app using the SDK version 1.6 and a target emulator configured at 1.6 level, the following code WORKS:

CODE:.........

When running the same code (compiled with SDK 1.6) and a target emulator at 2.0 level, the above code never return the entries I have populated in my the phone book. It's as if the phonebook was always empty.

A couple of additional observations;

- When running the emulator in 2.0 mode, the default local input type is Japaneese. Any way to change this ?

- Under the 2.0 emulator, and setting a "clean" AVD image, if you launch the dial button, press menu and select account, you'll probably immediatly get a "android.process.acore" error ...

- In the most recent SDK document, I can read that "People.CONTENT_URI" was deprecated after SDK 1.6. Therefore, I've changed the above code to:

CODE:.........

Unfortunatly, with the above, I get a crash right away when invoking ACTION_PICK.

Question to the Google Folks (dear dianne and others, please !);

How to we properly pick a phonebook contact under the 2.0 OS using 1.6 or 2.0 compiled apps ?

View 16 Replies View Related

Android :: Contact Picking On Motorola Cliq - 1.5?

Nov 24, 2009

I'm able to successfully use the contact picker on the Motorola Cliq using the intent:

new Intent(Intent.ACTION_PICK, People.CONTENT_URI)

It works as expected, and I'm able to get the contact data in onActivityResult()

However, every single time, I get an error dialog: "The application Contacts (process com.motorola.blur.contacts) has stopped unexpectedly. Please try again. (Force Close)"

The error in LogCat: android.app.SuperNotCalledException: Activity {com.motorola.blur.contacts/ com.motorola.blur.contacts.picker.PickPeopleActivity} did not call through to super.onDestroy()

So does this mean the contacts picker on the Cliq is just plain broken? Has anyone else seen this error, and/or been able to successfully use the contacts picker on the Cliq without getting error messages?

View 8 Replies View Related

Android :: WiFi Searching But Not Picking Up Network Anymore

Sep 22, 2010

the first day I had the phone, it was picking up wi-fi networks. I got it to connect to my home network, then it disconnected. Everyone I go into settings it is "Searching" and never picks up on my network anymore.I have googled to death. Can anyone suggest what is wrong or how to set this up.

View 4 Replies View Related

Android :: Picking A Contact And Returning To The Parent Activity

Jan 28, 2010

I wish to re-use the Contacts application in a way to enable the user to pick a contact and return it to the parent activity (my application's activity).

For achieving this, I want to inquire about the kind of Intent that will be needed to launch the contacts application.

Intent i = new Intent(Intent.ACTION_GET_CONTENT, ?); startActivityForResult(.....);

What should be the second argument here ?

In the deprecated Contacts API, I could use the following snippet, but not sure about ContactsContract:

Intent i= new Intent(Intent.ACTION_GET_CONTENT,People.CONTENT_URI); startActivityForResult(i, reqCode);

View 3 Replies View Related

Android :: DDMS Allocations Tracker Not Picking Up Activity When Using Real Phone

Aug 3, 2010

I'm trying to use DDMS to track my allocations, but it only finds my activity if I run it on the emulator. If I run my app on my phone it can't find it, even though it finds the phone. Is there anything specific that I need to do that I might have missed?

View 9 Replies View Related

HTC EVO 4G : Wifi Not Picking Up When In Range / How To Fix?

Sep 7, 2010

Not sure if any of you guys have the same problem but when I leave my Wifi on all day, and return home from work, my home Wifi never picks back up. When I toggle my Wifi on and off, it picks up again. My signal is always above 1 bar when on Wifi in my house, it just does NOT automatically connect anymore.

View 4 Replies View Related

Android :: ListView With Alternate Color And On Focus Color

Jun 17, 2010

I need to set alternate color in list view rows but when i do that it removes/ disables the on focus default yellow background

I tried with backgroundColor
rowView.setBackgroundColor(SOME COLOR);

also with backgrounddrwable.

CODE:.........

But it wont work. is there any way we can set background color and on focus color simultaneously which will work.

View 1 Replies View Related

Android :: Selection Color And Text Color In Whole Project

Apr 22, 2010

Is there any process to change the default text color white to "Black" and default selection color of android "orange" to "Blue" for whole project. i am using Eclipse for Android development.

View 3 Replies View Related

Android :: Use Own Color Instead Of Default Orange Color For Selection

May 23, 2009

1. I want to use my own color for selecting ui views.

By default, android shows the selected view with background as orange. I want to show the view background color as red.

2. In the same way, I want the same behaviour should be applied to whole application.

View 5 Replies View Related

Android :: Setting Color In Two Different Ways Color/color1

Mar 19, 2010

I have seen this example:

@*android:color/secondary_text_light

What's that * asterisk doing there? What is the difference when using or not?

View 1 Replies View Related

Android :: Customize Color Of CheckMark Color In A Dialog

Aug 16, 2010

How to customize the color of the CheckMark color in android in a dialog. Currently , By default, the color of the checkmark is green by default. I would like to customize it to a different color of choice

View 2 Replies View Related

Samsung Epic 4G :: Not Picking Up Email Very Well

Sep 2, 2010

One thing I've noticed though is that this thing just doesn't seem to be picking up my email very well at all...personal or work. Are any of you getting this issue? I'm used to the BB getting them almost instantly which is important to me because of my work. I'm also getting this notification saying "Network Error" from time to time. What's up with that? Overall I'm happy with this phone but I really hope that I can get my email situation solved.

View 49 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved