Android :: Use Gl.gluUnproject In OpenGL ES 1.1 Phone App To Know What Is Touched In 3D Space From Screen
Mar 21, 2010
How do I use gl.gluUnproject in my OpenGL ES 1.1 android app to determine what is selected when the user touches the screen?
My understanding is that the touch event results in a line and I have to find the first "thing" it intersects with.
Are there any tutorials on how to do this?
View 4 Replies
Feb 5, 2010
I'm having problems with gluUnProject. I saw other discussions on this message base regarding this function and they did not solve my problem. When I use GLU.gluUnProject I get values that are close, but not quite right. I'm manually keeping track of my model matrix and I replicate the projection matrix manually. (I have also tried setting the projection matrix to identity and manually incorporating a projection matrix into my model matrix, and I ended up with the same results). I tried using the builtin GLU.gluUnProject function and I also implemented my own based on reading that source and reading the C GLU sources and both seemed to give substantially similar results. So I put together a small demo, trying to keep it as minimal as possible and still get the point across. Either this demo shows a misunderstanding I have of gluUnProject or it shows a bug in the function or opengl projections. Can someone check this over and see if I'm just doing something wrong or if there's a bug that needs to be filed? The files are here: http://www.thenewsh.com/~newsham/unproj/ In particular:
unproj.java - full source to example unproj-debug.apk - resulting apk file unproj - directory with full ant-buildable project unproj.zip - zip of directory
View 7 Replies
View Related
Feb 24, 2010
I drew cubes using opengl,
GLSurfaceView has onTouchEvent method. but I'd like to know
what cube was touched ?
cubes can move anywhere in the viewport...
View 2 Replies
View Related
Sep 7, 2010
In my app I draw an image covering the entire screen. I want to now how can I know where the user touched the screen?
View 2 Replies
View Related
Sep 11, 2010
it just flips out goes up and down and the screen cant be touched untill i press the top button and it goes back to the screen lock, i have it rooted and running 2.2 im not all up on what this does should i just reset to og settings?
View 1 Replies
View Related
Oct 5, 2010
I am experiencing a problem with my app. The 1st screen that appears is a map that displays pins that are located based on an XML file that is loaded from our server.
Sometimes the app loads as expected. Other times, the map loads but none of the pins appear until you touch the screen.
View 2 Replies
View Related
Mar 11, 2014
This may be an Android 4.4 or Nexus 4 problem, but I suspect the former. I encrypted the device (using the in-built encryption stuff) and have found that now the touchscreen will only register if another part of it is touched. For example, when entering my PIN once I get into the OS itself, I have to hold down a finger somewhere else on the screen (usually having to move it between some of the later numbers).
When it comes to multi-touch features (zooming etc.), these work fine but still require another finger held down somewhere to work.
This is definitely a software problem as the touchscreen works fine when putting in the password to decrypt storage.
Is this supposed to happen - part of the encryption process - or is this a bug?
View 1 Replies
View Related
Mar 7, 2010
Ever since I bought my hero in December, I have had this problem where if I'm in a game, and it requires the screen to be touched, the game stutters. This happened when I had the stock 1.5. I needed to trade my hero for another when a lot of dust showed up under the screen, so Sprint gave me another one, only this one worked perfectly. No stuttering at all. So I decide to root it, and now it's running Aloysius, and the stuttering is back. Does anyone know what could be causing this? It happens in both the official and unofficial firmware. I can't seem to find an answer anywhere. Games it does this in includes: Nesoid and snesoid, and Raging Thunder to name a few. These games worked perfectly to my shock when I got the new phone, as I originally thought it was just a hero problem. I even emailed the developer of Nesoid but he didn't know the cause. Any suggestions?
View 2 Replies
View Related
Sep 11, 2010
On Aug 10, 2010 I purchased an unlocked HTC Legend (A6365 - HSPA 850/1900/2100 Mhz). The phone operated wonderfully until Sep 8, 2010. At that time, the Notification bar couldn't be "pulled-down" anymore. Additionally, without rhyme or reason, when I touch the screen, the notification panel will open randomly. This renders the phone useless since every time I touch the screen, the notification panels opens. I tried a softboot and a factory reset. Neither action resolved the issue. I contacted HTC USA support and they suggested clearing the calendar data and vigorously rubbing my hands together and then touch the screen whenever the issue occurred. No success. This issue occurs whether the SIM card is installed or not. I can safely say that no new applications were installed within 48 hours of the issue starting.
I search the available forums and found at least three other instances of this same issue:
http://www.htclegendforum.com/htc-legend-troubleshooting/touchscreen-bug/
http://www.htcforums.com/legend/5838-touchscreen-bug.html
http://androidforums.com/htc-legend/153561-notification-area-swipedown-not-working.html
Regrettably, none of these threads have any answers. HTC support then recommended for me to contact HTC Return Merchandise Authorization & Repair Center. This group (in the USA) cannot accept the phone for troubleshooting because this phone is not available in the USA. Based on the behavior thus far, I suspect this is an issue with the firmware becoming unstable. The phone hasn't been exposed to any drastic environmental changes (heat, cold, excessive dust, etc).
Software info follows:
Firmware version: 2.1-update 1
Baseband version: 47.37.35.09U_7.09.35.05
Kernel version: 2.6.29-9e497c43
Build number: 2.02.666.3 CL1777708 release-keys
Software number: 2.02.666.3
Browser version: WebKit 3.1
By know, HTC should have received multiple complains of this issue and I hope they have a solution for it. The options of the phone are great, reception is wonderful and performance is superb (except for this issue).
View 5 Replies
View Related
Jan 31, 2010
How do I add a marker on a particular location in the map?
I saw this code that shows the coordinates of the touched location. And I want a marker to pop or be shown in that same location everytime it is touched. How do I do this? Code...
View 2 Replies
View Related
Apr 4, 2014
I was able to flash ROM from : LNK1 but I have a problem with touchscreen which works upside down. When I press screen on top it actually shows that I pressed at bottom of screen. I was looking for solution many days and have learned a lot from many sites and different forum threads, but surprisingly non of the solution works for me. I am not able to reach proper file to change proper property to change this behavior. Most probably i need to set somewhere: ctp_revert_y_flag = 1 as described here: LNK2, but I am not able to find nor edit script.bin on my phone, here I found some info: LNK3 and also here is very interesting info about partitions: LNK4 but I can't find this script.bin on my phone.
My phone is china phone 1:1 Real MTL 6589 GT-I9500, I was able to flash several ROM's using SP Flash tool from LNK5, I know how to do this, but no matter which ROM I flash no matter which recovery image I flash this touch screen behavior is still upside down as described.
1. set ctp_revert_y_flag = 1 in script.bin on my phone - I can't mount proper partition, don't know which partition should I mount, can't find this file
2. set ctp_revert_y_flag = 1 in script.bin on ROM file before flashing - don't know where to look for this file and don't know how to edit ROM before flashing.
What I know: how to root my phone, how to get to it using adb, how to use android-sdk, how to flash using SP flash tools, how to use recovery mode, clean user data, how to use SP Flash tool, how to switch on developer mode, switch on USB debugging, switch on "show touches".
View 3 Replies
View Related
Nov 20, 2009
i want to get the 3D coordinate from the android screen x,y coordinate i choose to use the gluUnProject but the gluUnProject function always returns NaN why?
View 3 Replies
View Related
Sep 16, 2010
When the Bluetooth is on and I am near my laptop, incoming calls are connected without the phone being touched. I have seen a few comments about this in other threads, so it is not just me and this is the 3rd replacement phone, so it is not just a one-off fault.
Advice and guidance please?
View 1 Replies
View Related
Sep 9, 2010
i got this notification yesterday so i deleted some apps and all my text messages but i cant get rid of it now!
any ideas?
View 14 Replies
View Related
Oct 7, 2010
I have follow an example of an opengl application and I don't know why is this thing happening...I have a GLSurfaceView with it's corresponding renderer drawing a triangle. But, instead of getting the whole view on screen, I have just the upper half, and it's also duplicated as you can see on the picure. I'm using a Nexus One.
View 3 Replies
View Related
Dec 16, 2009
Had my Samsung Moment for about a month. LOVE IT. Few issues (same as everyone else has noticed), but nothing terrible. Until: Randomly today TWO Notifications popped up that said "Low on space Phone storage space is getting low." One was what seemed to be from the "hardware" and the other was from the "Work Mail" app (which I don't use, haven't used, haven't even opened). When I click it, it takes me to the Manager screen. So, I began uninstalling some apps I don't really use (I didn't have that many anyway...a couple of games [Solitaire, etc], Facebook, Notes). It started running really slowly and random Force Close messages would appear for things like android.process, messaging--things that have never Force Closed before. I turned it off (pressed and held the red button), waited a few seconds, then turned it back on again. Immediately after the "Sprint" logo lights show finished, I got another Force Close message. When the Home Screen showed up, I had the two notifications again "Low on space". When I cleared the notifications, only the "Work Mail" one would clear. I went through and deleted some more apps that I don't use. Got on my computer & Googled the issue. Found a couple of random forums that suggested cleaning out the Cache in the Browser. I did that. Cleaned the History & Cookies in the Browser, too. Then, I did a soft reset (took out the battery). Started it up again, SAME notifications. Less Force Close messages. But, it's running VERY slowly.
After a few hours, I noticed that I hadn't received any text messages or Gmail notifications. I had my sister text me about 2 hours ago. Still have not received it.
I really don't want to hard reset. I haven't synced my contacts (I have over 400 & the Sprint store had trouble moving them from my Centro to the Moment) to Google yet, nor have I hooked my Moment up to my Mac yet (the Sprint guys had no idea if it would work or not with Snow Leopard & I hadn't had time to check yet) and I'm worried to try it now that my Moment has gone crazy...I really don't want to lose 400 contacts.I don't download a lot of apps. Most are reputable (Pandora, MotherTED, Shazam, Movies, Jewels). The last one I remember downloading was Google Voice three days ago (which I haven't really used because I've had the flu). I don't know if this is a Malware/Virus issue or if I'm just an idiot & did something wrong. But, it's running REALLY slowly right now. Still not receiving texts or emails (though my Twitter app has notified me of a couple of @ replies).I'm going to call Sprint & Samsung tomorrow, then go to a Sprint tech store if they can't help. But, I'm just hoping one of you have come across this & can help before I have to deal with hours of hold music & techies who tell me to soft reset over & over again.
BTW:
After awhile, I finally checked the storage space:
External SD care: Total: 1.89; Available: 1.85
Internal: About 2 hours ago when I first checked, after I had deleted a bunch of apps it said I had 7.something MB, now (after not downloading ANYTHING or barely even TOUCHING the damn thing) it says 1.95MB. Which leads me to believe that the 7.whatever was not necessarily accurate.
View 31 Replies
View Related
Oct 23, 2009
I've just dusted off an application I did for Android half a year ago. I upgraded to the latest SDK and Eclipse ADT. After some struggeling I get the application to run again. When I debug it I can see that all the right code are executed the right way. The application shows a OpenGL surface and animates stuff on it. It used to work perfectly (I even have it running on my HTC Magic device), but in the new emulator the screen is just white?
View 11 Replies
View Related
Apr 7, 2010
For some reason my code here (this is the entire thing) doesnt actually render anything besides a red screen..
can anyone tell me why?
CODE:.................
View 2 Replies
View Related
Feb 9, 2010
I am very new to OpenGL ES. I am implementing some demo app to load multiple textures on the screen. For demo purpose I have loaded 2 textures in 2 different locations on the screen using glTranslatef() and glBindTextures() twice. Now I am able to see 2 different images on the screen. Now I want to move one particular texture across the screen using mouse.
View 2 Replies
View Related
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
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
Jun 27, 2010
Can somebody take me step-by-step how to draw 2D stuff over a 3D scene (such as controls, etc.). What I've been doing so far has not been working (it only draws the 3D scene), which is (in every frame): draw the 3D scene as normal, projection matrix mode, load identity, call GLU.gluOrtho2D(gl, 0, myScreenWidthInPixels, 0, myScreenHeightInPixels), switch the array pointers (vertices and texture coords) to the ones for my 2D stuff, then drawElements with an appropriate index list. (then switch the array pointers back so the 3D stuff works again).I get nothing added to the screen (just the 3D stuff).Do I need to be doing something else for it to draw? Can somebody take me step-by-step?
View 5 Replies
View Related
Nov 2, 2009
Dear all, I want to implement the transition effect ( transparent with Z axis ) when user slip the android home to change home page. therefore, I plan to launch the new activity that is implemented by OpenGL ES to perform this effect. However, i encounter a problem that the screen/display is dark momentarily when launching the OpenGL ES activity.
View 3 Replies
View Related
Nov 10, 2010
I'm developing an Android application. I'm very new on it. I have the following classes:
class CustomGLSurfaceView extends GLSurfaceView
class CustomRenderer implements GLSurfaceView.Renderer
CustomGLSurfaceView uses CustomRenderer to render a cube on onDrawFrame method.
I've added an onTouchEvent(MotionEvent event) on CustomGLSurfaceView to manage touch events:
class CustomGLSurfaceView extends GLSurfaceView {
// For touch inputs - previous touch (x, y)
private float previousX; private float previousY;
private CustomRenderer myRenderer; public CustomGLSurfaceView(Context context) {
super(context); myRenderer = new CustomRenderer(); setRenderer(myRenderer);
} @Override public boolean onTouchEvent(MotionEvent event) {
float currentX = event.getX(); float currentY = event.getY();
switch (event.getAction()) { case MotionEvent.ACTION_MOVE:
myRenderer.handleMovement(currentY, currentY, previousX, previousY);
} // Save current x, y
previousX = currentX; previousY = currentY;
return true; // Event handled } }
May I have to modify onDrawFrame to draw something new or to rotate the cube? I thing I must do it on handleMovement.
View 1 Replies
View Related
Sep 18, 2009
I've been working on a game framework for a little while, and while its far from perfect, I've put the current version online. To be honest, I haven't used much OpenGL in the past. Before last week I had never tried using it. If anyone would like to take a look, please do, I'd appreciate all the help possible on speeding it up. There are many features I have in mind and am planning at the minute, but so far it supports:
# Texture and Sprite management # Text, using TTF fonts # Organised layers # Two audio management classes, one optimized for music, the other for sound effects # Sprite dynamics (acceleration, terminal velocity, collisions) # Animation # Handlers to manage events fired through movement, animation, screen touches, accelerometer input, device shaking and collisions # Several minor features aimed at speeding development, such as screen settings and vibration.
View 1 Replies
View Related
Jun 6, 2010
I would like to make a Linear Layout that was created from xml invisible, and another Linear Layout visible to replace it. The replacement layout starts out as invisible. When I make the originally visible layout invisible, it still leaves space for it on the screen. How can I refresh the screen so that space is gone?
View 2 Replies
View Related
Jul 7, 2010
I have a single bitmap with several individual pictures in (each one is an option) and I would like to detect when the user touches these pictures. I am using the event.getX and event.getY to detect where is pressed, I know the top left X Y and bottom right location of each of the pictures. What is the best way of detecting which one is pressed? (i.e. tieing up the event press and which picture has been pressed?
View 2 Replies
View Related
Jul 31, 2009
I would like to use an <include /> in my XML file to add a layout below a MapView(or any other greedy layout). I have been trying for a few hours now, and no luck so far. I was hoping someone could give me a hand.
Here is what my XML looks like now:
CODE:...................
Optimally, the include could be any sort of other layout. The goal here is to have the Google map on the top, and then have the included layout below it. If I include the content in the layout, such as replacing the <include /> tag with a <TextView /> then that works correctly, so I am thinking I am mis-using the include. A trip to hierarchy viewer shows that the included layout has no height. I have tried putting the include first, and using a RelativeLayout to position the map above the included layout, but I could not get that to work correctly (the included layout took the entire screen space, even though I explicitly said layout_height='wrap_content'
View 2 Replies
View Related
May 15, 2010
I like the calendar on the Incredible and like what it does. BUT, there's also a little icon to open it so why does a whole page/screen need to be devoted to it? Can't I get rid of it somehow and just use the little to load it when I need to calendar something?
View 1 Replies
View Related
Oct 28, 2010
I assumed this feature would be activated by default. How do I set an Edit Text box to do the normal orange highlighting when a user touches it?
View 1 Replies
View Related