[android-developers] Re: OpenGL Problem

2011-09-15 Thread cybice
The *more information* you provide, the better your results will be. But the easiest solutions: If you draw all in 3d see glEnable(GL_DEPTH_TEST) also glDepthFunc If 2D you can create sprites with alpha channel (png), disable GL_DEPTH_TEST, set blending GLES20.glEnable(GLES20.GL_BLEND);

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-28 Thread pedr0
I solved all my problmes, there was a little stupid little issues during the copy of my Vertex and CoordTexture on the buffers... Thanks lot however, the theory I read is a good exercise for the next time! Bye! On 28 Dic, 01:52, Robert Green rbgrn@gmail.com wrote: Well said Kostya.

[android-developers] Re: openGL problem

2010-12-28 Thread MartyMacFly
I'm not sure why are you disabling depth test for a sphere and also you should clear color/depth buffer in onDrawFrame On Dec 27, 12:10 pm, pedr0 pulsarpie...@gmail.com wrote: img198(dot)imageshack(dot)us/img198/6370/failfs.png -- You received this message because you are subscribed to the

[android-developers] Re: openGL problem

2010-12-27 Thread pedr0
This a link of my issues -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to

[android-developers] Re: openGL problem

2010-12-27 Thread pedr0
img198(dot)imageshack(dot)us/img198/6370/failfs.png -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-27 Thread pedr0
But normal.x what is it? Is the abs(x) ? On 23 Dic, 20:41, Robert Green rbgrn@gmail.com wrote: UV unwrapping/mapping is standard practice in 3d games.  It's how the artist lines up the textures onto the skin/model. You're doing UV coordinate generation, which is similar but is

Re: [android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-27 Thread Kostya Vasilyev
Pedro, A normal is a unit vector (length == 1) that is perpendicular to the surface. Normals are used for shading, so don't worry about them too much for now. Texture coordinates, as was already pointed out here, are in 2D space, i.e. two coordinates. The reason is that textures are

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-27 Thread Robert Green
Well said Kostya. Pedro - I defined the formula to get your normal above. A normal is a unit vector (a 3D vector of length 1.) Each vertex must have a normal for proper shading, as that's how light is calculated. The normal of a vertex of a sphere is a easy to calculate. Think of it as the

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-23 Thread pedr0
Thanks a lot, especially at Robert Green for his very good explanation! The absurd thing is that the code which I posted above is 100% right in a iPhone iOS, but when I port the same code on the Android platform I have these issues. I will try to do what you are talking about normals and I let

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-23 Thread pedr0
What do you think about it? http://en.wikipedia.org/wiki/UV_mapping On 23 Dic, 09:19, pedr0 pulsarpie...@gmail.com wrote: Thanks a lot, especially at Robert Green for his very good explanation! The absurd thing is that the code which I posted above is 100% right in a iPhone iOS, but when

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-23 Thread Robert Green
UV unwrapping/mapping is standard practice in 3d games. It's how the artist lines up the textures onto the skin/model. You're doing UV coordinate generation, which is similar but is mathematically specified instead of placed by a 3D modeling application. On Dec 23, 12:37 am, pedr0

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Robert Green
pedro, your problem has nothing to do with android. I think you may need a 3D refresher to solve it. Normals are not UVs. Your UVs will depend on how you want to map, but the easiest way to do it is to map from the sphere center out using angles, like this. Since GL has 2D texture coordinate

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Robert Green
Also I should add that your sphere normal should be (sphereCenter - point).Normalize() and will be a 3D vector. Normals are 3D, UVs are 2D. On Dec 22, 9:09 am, pedr0 pulsarpie...@gmail.com wrote: Please see the link and reply inside  this post if you have not an account on OpenGL forum, the

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Robert Green
Oh here is a faster method - http://www.mvps.org/directx/articles/spheremap.htm For each point (Assuming Y=up): 3DVec normal = (sphereCenter - point).normalize(); float U = asin(normal.x)/PI + 0.5 float V = asin(normal.y)/PI + 0.5 for z=up: float U = asin(normal.x)/PI + 0.5 float V =

[android-developers] Re: OpenGL Problem with Sphere Texture Mapping

2010-12-22 Thread Mario Zechner
On 22 Dez., 20:42, Robert Green rbgrn@gmail.com wrote: 3DVec normal = (sphereCenter - point).normalize(); 3DVec normal = (point - sphereCenter).normalize(); Or your world will be upside down. Unless my brain is totally borked :) (could well be, 4am here...) -- You received this message