[android-developers] Re: How to apply different textures on different faces of a cylinder

2010-04-24 Thread Lance Nanek
This uses a custom library, but the calls to set things like texture
coordinates are pretty obvious:
http://code.google.com/p/skylight1/source/browse/trunk/Skylight1Demos/OpenGL/TankedActivity/src/skylight1/opengl/tanked/TankedGLRenderer.java#162

It is changing the texture coordinates like it does because all the
various rotations are little images in the same texture and it is
deciding which to use:
http://skylight1.googlecode.com/svn/trunk/Skylight1Demos/OpenGL/TankedActivity/res/drawable/tank.PNG

This is a 2D demo, so it rotates by picking different images to use
from a sprite sheet. A 3D version would use a geometry that looked
more like an actual tank and actually rotate it. This uses a pair of
triangles making up a square. Just rotating the square in this
wouldn't look right because each sprite was drawn with a perspective
and built-in lighting coming from a certain direction.

On Apr 14, 11:56 pm, kirti kaul  wrote:
> Thanks,can you give me an example/Snippet on how to use Atlas Texture
> in openGL ES?
>
> On Apr 13, 4:08 pm, Lance Nanek  wrote:
>
> > Put all the images needed for texturing all the faces into a single
> > texture. Then refer to coordinates inside the texture to use different
> > parts of it in different places. This is called an atlas texture. I
> > suppose it is also possible to draw the different parts in separate
> > draw calls with a different texture object bound, or to use a second
> > texture unit at the same time.
>
> > On Apr 12, 1:15 am,kirtikaul  wrote:
>
> > > Hello,
>
> > > Can anybody tell me how to apply apply different textures on different
> > > faces of acylinder?I am able to apply one texture which covers the
> > > wholecylinder.But I want one texture for each face.
>
> > > Thanks in advance!!!- Hide quoted text -
>
> > - Show quoted text -
>
>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to apply different textures on different faces of a cylinder

2010-04-15 Thread Mario Zechner
kirti, when doing OpenGL programming it's best to actually know what
you do. Just copy and pasting code will lead to more problems that you
can't solve due to a missing understanding of how OpenGL works.
Consider following Robert's suggestion and get your hands on the Red
Book and the OpenGL Superbible. Note that you can not directly use
everything found in there as those books are for desktop OpenGL which
offers functionality not available in OpenGL ES. I therefore also
suggest reading the tutorial series on OpenGL ES for the IPhone. The
examples are written in Objective-C/C++ but should be very easy to
port over to Java. 
http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html.

hth

On 15 Apr., 05:56, kirti kaul  wrote:
> Thanks,can you give me an example/Snippet on how to use Atlas Texture
> in openGL ES?
>
> On Apr 13, 4:08 pm, Lance Nanek  wrote:
>
> > Put all the images needed for texturing all the faces into a single
> > texture. Then refer to coordinates inside the texture to use different
> > parts of it in different places. This is called an atlas texture. I
> > suppose it is also possible to draw the different parts in separate
> > draw calls with a different texture object bound, or to use a second
> > texture unit at the same time.
>
> > On Apr 12, 1:15 am,kirtikaul  wrote:
>
> > > Hello,
>
> > > Can anybody tell me how to apply apply different textures on different
> > > faces of acylinder?I am able to apply one texture which covers the
> > > wholecylinder.But I want one texture for each face.
>
> > > Thanks in advance!!!- Hide quoted text -
>
> > - Show quoted text -

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: How to apply different textures on different faces of a cylinder

2010-04-14 Thread kirti kaul
Thanks,can you give me an example/Snippet on how to use Atlas Texture
in openGL ES?

On Apr 13, 4:08 pm, Lance Nanek  wrote:
> Put all the images needed for texturing all the faces into a single
> texture. Then refer to coordinates inside the texture to use different
> parts of it in different places. This is called an atlas texture. I
> suppose it is also possible to draw the different parts in separate
> draw calls with a different texture object bound, or to use a second
> texture unit at the same time.
>
> On Apr 12, 1:15 am,kirtikaul  wrote:
>
>
>
> > Hello,
>
> > Can anybody tell me how to apply apply different textures on different
> > faces of acylinder?I am able to apply one texture which covers the
> > wholecylinder.But I want one texture for each face.
>
> > Thanks in advance!!!- Hide quoted text -
>
> - Show quoted text -

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: How to apply different textures on different faces of a cylinder

2010-04-13 Thread Lance Nanek
Put all the images needed for texturing all the faces into a single
texture. Then refer to coordinates inside the texture to use different
parts of it in different places. This is called an atlas texture. I
suppose it is also possible to draw the different parts in separate
draw calls with a different texture object bound, or to use a second
texture unit at the same time.

On Apr 12, 1:15 am, kirti kaul  wrote:
> Hello,
>
> Can anybody tell me how to apply apply different textures on different
> faces of a cylinder?I am able to apply one texture which covers the
> whole cylinder.But I want one texture for each face.
>
> Thanks in advance!!!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: How to apply different textures on different faces of a cylinder

2010-04-11 Thread Robert Green
Kirti - Get either the OpenGL superbible or the redbook.  It's money
well-spent.

On Apr 12, 12:15 am, kirti kaul  wrote:
> Hello,
>
> Can anybody tell me how to apply apply different textures on different
> faces of a cylinder?I am able to apply one texture which covers the
> whole cylinder.But I want one texture for each face.
>
> Thanks in advance!!!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: How to apply different textures on different faces of a cylinder

2010-04-11 Thread Kumar Bibek
Draw your faces separately with different paint objects.

Thanks and Regards,
Kumar Bibek

On Apr 12, 10:15 am, kirti kaul  wrote:
> Hello,
>
> Can anybody tell me how to apply apply different textures on different
> faces of a cylinder?I am able to apply one texture which covers the
> whole cylinder.But I want one texture for each face.
>
> Thanks in advance!!!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.