[android-developers] Re: glDrawElements vs glDrawArrays with glColorPointer in opengl es GL10

2010-03-24 Thread Perty

Ok,

So the conclution is that it's not working the way I thought it
would :-)

I'm importing the vertex, colors and normals from a collada.xml and
it's build in a nice way with indices so I assumed they had OpenGL in
mind when they developed the format and therefore pursued with the
glDrawElement...

I'll go with the glDrawArrays which working really nice, but this
issue really annoyed me.

Thanks both Robert and Mario.

/Perty


On 24 mar, 18:37, Robert Green  wrote:
> In short, what mario is saying is that if you have the same vertex and
> you want different texture coordinates for it (like if you want to
> display the same texture on each side of a cube, the verts each need 3
> different texture coordinates), it's no longer the same vertex but a
> different vertex with a different texture coordinate at the same
> location.
>
> A cube is one of the most extreme examples of inefficiencies as far as
> that goes because it has those hard edges and generally you want the
> texture to not wrap around it but instead to be face-aligned, which is
> why you must duplicate each vertex 3 times.  Your indices will still
> save you a little duplication because you still need 2 triangles per
> side and those CAN share 2 vertices, like in my example above.
>
> a better example of efficiency is with characters.  Textures tend to
> wrap around them nicely and they are usually smooth for most of the
> top so you get very good vertex sharing on them.
>
> On Mar 24, 10:45 am, Mario Zechner  wrote:
>
> > You can't specify that with indices. Instead you will have to
> > duplicate those vertices which share the same position but have
> > different normals, colors and texture coordinates. Think of it this
> > way: You have an array of vertices, each defined by a position, color,
> > normal and texture coordinates. When you specify the different
> > glXXXPointers you simply tell OpenGL where to look for the position,
> > normal, color and texture coordinates of a single vertex. The pointers
> > you give OpenGL point to the first vertex' attributes. When you then
> > specify your indices later on when invoking glDrawElements the indices
> > map to that vertices array. An index of 0 will take the first position
> > from the pointer you passed to glVertexPointer, the first color from
> > the pointer you passed to glColorPointer and so on. You can not say:
> > use the position at index 0 in the vertex position array and the color
> > from position 3 in the color array for this vertex. Thus the 1:1:1:1
> > mapping.
>
> > On 24 Mrz., 10:11, Perty  wrote:
>
> > > Hi Robert, thanks for your help.
>
> > > Yes, thats makes sense and it's exactly how I do it I think.
>
> > > But does the relationship (1 to 1 to 1 to 1,
> > > vertexarray,colorarray,normalarrat, textmaparray) still apply when you
> > > use glDrawElements ?
>
> > > For example a when creating a 3D cube, the same vertex could have
> > > three different colors and three different normals depending on the
> > > triangle it belongs to, so the arrays can't have (?) the same one to
> > > one relationship.
>
> > > So, the question is how do I map the colors to the indexed vertex?
>
> > > /Perty
>
> > > On 24 mar, 06:00, Robert Green  wrote:
>
> > > > Vertices, Texture coordinates, Normals and Colors have a 1 to 1 to 1
> > > > to 1 relationship.  That means that for any given vertex, you can
> > > > define:
>
> > > > The vertex's location
> > > > The texture coordinate
> > > > The normal
> > > > The color
>
> > > > If you define 4 vertices (with or without any of the other attributes,
> > > > doesn't matter), you can draw 2 triangles using drawElements.
>
> > > > Let's say that your verts define the following for a 2d square:
>
> > > > top left, top right, bottom right, bottom left
>
> > > > Easy enough, clockwise rotation.
>
> > > > Your indices would look like:  0,1,2, 0,2,3
>
> > > > let's say you put that into a directly-allocated ShortBuffer called
> > > > indexBuffer.
> > > > You'd then just call glDrawElements(GL10.GL_TRIANGLES, 6,
> > > > indexBuffer);
> > > > which says, "draw triangles using 6 points indexed by this index
> > > > buffer"
>
> > > > Make sense?
>
> > > > On Mar 23, 6:09 pm, Perty  wrote:
>
> > > > > Hi,
>
> > > > > If I use a glColorPointer together with a glVertexP

[android-developers] Re: glDrawElements vs glDrawArrays with glColorPointer in opengl es GL10

2010-03-24 Thread Perty

Hi Robert, thanks for your help.

Yes, thats makes sense and it's exactly how I do it I think.

But does the relationship (1 to 1 to 1 to 1,
vertexarray,colorarray,normalarrat, textmaparray) still apply when you
use glDrawElements ?

For example a when creating a 3D cube, the same vertex could have
three different colors and three different normals depending on the
triangle it belongs to, so the arrays can't have (?) the same one to
one relationship.

So, the question is how do I map the colors to the indexed vertex?

/Perty


On 24 mar, 06:00, Robert Green  wrote:
> Vertices, Texture coordinates, Normals and Colors have a 1 to 1 to 1
> to 1 relationship.  That means that for any given vertex, you can
> define:
>
> The vertex's location
> The texture coordinate
> The normal
> The color
>
> If you define 4 vertices (with or without any of the other attributes,
> doesn't matter), you can draw 2 triangles using drawElements.
>
> Let's say that your verts define the following for a 2d square:
>
> top left, top right, bottom right, bottom left
>
> Easy enough, clockwise rotation.
>
> Your indices would look like:  0,1,2, 0,2,3
>
> let's say you put that into a directly-allocated ShortBuffer called
> indexBuffer.
> You'd then just call glDrawElements(GL10.GL_TRIANGLES, 6,
> indexBuffer);
> which says, "draw triangles using 6 points indexed by this index
> buffer"
>
> Make sense?
>
> On Mar 23, 6:09 pm, Perty  wrote:
>
> > Hi,
>
> > If I use a glColorPointer together with a glVertexPointer and a
> > glNormalPointer the vertex is all in the same position in the array
> > (taking into accont the stride).
>
> > Thats working fine.
>
> > But if I want to use the glDrawElement to save some memory
> > (performance?) I do not understand how I should map
> >  the normals and the colors.
>
> > How does the vertexIndex lookup table relates to the colors and
> > normals?
>
> > The glDrawElements is rendering the triangles fine but the normals and
> > colors is all messed up. So I manually traverse the the index and
> > creates a vertexArray now.
>
> > It feels like I have just made a simple error.
>
> > /Regards Perty

-- 
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 from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] glDrawElements vs glDrawArrays with glColorPointer in opengl es GL10

2010-03-23 Thread Perty
Hi,

If I use a glColorPointer together with a glVertexPointer and a
glNormalPointer the vertex is all in the same position in the array
(taking into accont the stride).

Thats working fine.

But if I want to use the glDrawElement to save some memory
(performance?) I do not understand how I should map
 the normals and the colors.

How does the vertexIndex lookup table relates to the colors and
normals?

The glDrawElements is rendering the triangles fine but the normals and
colors is all messed up. So I manually traverse the the index and
creates a vertexArray now.

It feels like I have just made a simple error.

/Regards Perty

-- 
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 from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: SDK and Linux 64 bits

2010-01-17 Thread Perty
Hi,

If you run 64 bit you need 32 bit libraries. I don't know exacly which
libraries:

if you run "strace ./adb" or "strace ./emulator" you could see which
libraries you are missing.

/per jonsson

On 4 Jan, 10:53, Nanard  wrote:
> Hi,
>
> I have installed Mandriva 2010 32 bits   :-)
> Unfortunately 'adb' still had a problem but, it gave me some error
> messages this time.  (all was OK on Mandriva 2009 !)
>
> So, I had to manually setup this file :  /etc/udev/rules.d/50-
> android.rules
>
> SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="0bb4", MODE="0660",
> GROUP="plugdev"
> SUBSYSTEM=="usb|usb_device", ATTR{idVendor}=="0bb4", ATTR{idProduct}
> =="0c02", SYMLINK+="android_adb"
> SUBSYSTEM=="usb|usb_device", ATTR{idVendor}=="0bb4", ATTR{idProduct}
> =="0c01", SYMLINK+="android_fastboot"
>
> Mandriva 2010 64 bits and Android SDK are not yet compatibles :-(
-- 
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: DB location

2009-12-14 Thread Perty

A really nice feature is that the SQLite db is binary compatible on
all different platforms so you can copy the database.db file to your
computer and use any SLQLite tools to look and test the db.

So you could then connect to the db thru jdbc and use for example
eclipse with the sql tools and examine the db. I used the freeversion
of VisualDB (http://www.minq.se/products/dbvis/)

Very nice indeed.

Optimal would be to connect to the db directly on the phone or the
emulator but I havn't tried that, yet.

/Perty


On 14 Dec, 10:02, Mark Murphy  wrote:
> Jags wrote:
> > does that mean i wont be able to locate the db file ?
>
> On the emulator, you should have no problems. On a device, though,
> security restrictions will prevent you from finding it.
>
> > I saw a data
> > folder in android sdk /platforms /1.5/  but it does not follow
> > structure after that like data//databases
>
> That is your PC. You do not want to look on your PC. You want to look on
> your *emulator*.
>
> > and there is no data folder generated in bin folder of my workspace.
>
> That is your PC. You do not want to look on your PC. You want to look on
> your *emulator*.
>
> Use DDMS's File Manager, or adb push and adb pull, to work with files on
> the emulator:
>
> http://developer.android.com/guide/developing/tools/ddms.htmlhttp://developer.android.com/guide/developing/tools/adb.html
>
> > but when i do a
>
> > long i = c.getLong(c.getColumnIndex("MyId"));
>
> > I get a zero, i tried getInt also, did not work. i am convinced it is
> > proper pk value in the db because, MyId is INT PRIMARY KEY
> > AUTO_INCREMENT
>
> You really should consider naming that _ID instead of MyId.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in US: 11-15 January 2010:http://onlc.com

-- 
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: Different versions of searchable.xml for different sdk targets?

2009-11-04 Thread Perty
Hmm...

Didn't work as expected when testing at home with 1.5, works nicely on
1.6.

Get these errors with the attributes just defined in 1.6:
ERROR No resource identifier found for attribute
'includeInGlobalSearch' in package 'android'searchable.xml  /app/res/
xml-v4  line 2  Android AAPT Problem

/Regards Perty


On 3 Nov, 17:17, Romain Guy  wrote:
> The syntax is xml-v4/, with a dash instead of an underscore.
>
>
>
> On Tue, Nov 3, 2009 at 1:55 AM, Perty  wrote:
> > Hi!
>
> > I have  implemented a SearchManager which make uses of a
> >searchable.xmlwith all the settings and put it in the xml/ directory.
>
> > I tried to create a new directory called xml_v4/ to add some
> > attributes (the android:includeInGlobalSearch ie) which isn't
> > supported in sdk3/1.5 but the xml directory seems not to be supported
> > by the dir_suffixes.
>
> > How do I deal with this? Someone have any suggestions?
>
> > I want to have one binary for different targets.
>
> > Regards Perty
>
> > --
> > 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
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them

-- 
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: Different versions of searchable.xml for different sdk targets?

2009-11-04 Thread Perty
Thanks!

Worked like a charm.

/Perty


On 3 Nov, 17:17, Romain Guy  wrote:
> The syntax is xml-v4/, with a dash instead of an underscore.
>
>
>
> On Tue, Nov 3, 2009 at 1:55 AM, Perty  wrote:
> > Hi!
>
> > I have  implemented a SearchManager which make uses of a
> >searchable.xmlwith all the settings and put it in the xml/ directory.
>
> > I tried to create a new directory called xml_v4/ to add some
> > attributes (the android:includeInGlobalSearch ie) which isn't
> > supported in sdk3/1.5 but the xml directory seems not to be supported
> > by the dir_suffixes.
>
> > How do I deal with this? Someone have any suggestions?
>
> > I want to have one binary for different targets.
>
> > Regards Perty
>
> > --
> > 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
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them

-- 
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] Different versions of searchable.xml for different sdk targets?

2009-11-03 Thread Perty
Hi!

I have  implemented a SearchManager which make uses of a
searchable.xml with all the settings and put it in the xml/ directory.

I tried to create a new directory called xml_v4/ to add some
attributes (the android:includeInGlobalSearch ie) which isn't
supported in sdk3/1.5 but the xml directory seems not to be supported
by the dir_suffixes.

How do I deal with this? Someone have any suggestions?

I want to have one binary for different targets.

Regards Perty

-- 
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: Running Android SDK 1.1 R1 on Linux 64 bit Fedora 11 RawHide

2009-04-20 Thread Perty

Are you sure you are running the 64 bit version of Fedora?

Or maybe you have installed all the 32 bit libraries before
(dependencies of other packages?) the emulator and other binaries need
the 32 bit libraries.

I can't se how you got it to work otherwise.

/Per Jonsson



On 16 Apr, 04:17, "Raymond C. Rodgers" 
wrote:
> I've been running the Android SDK for some time on Fedora 10 64-bit
> without any problems; I didn't even need to do anything special (beyond
> downloading the Eclipse plugin) to get it running once I used the Fedora
> package manager to download and install Eclipse and the related Java
> development extensions. I expect the same for F11 and Android SDK 1.5
> though I haven't tried either yet.
>
> Raymond
>
> pj.paito wrote:
> > Like you said yesterday I am worried about installing the 1.5 SDK on a
> > 64bit linux machine am downloading now.
>
> > On Apr 7, 4:33 pm,Perty wrote:
>
> >> How to get Android SDK 1.1 R1 (android-sdk-linux_x86-1.1_r1) working
> >> on 64 Bit Linux, Fedora 11 Beta RawHide. (this could surely be applied
> >> to other distros as well I suppose but I have just tested the above)
>
> >> Download the "eclipse-java-ganymede-SR1-linux-gtk-x86_64.tar.gz"
> >> eclipse.org. The version from Fedora repository doesn't work due to
> >> incompatible packages / versions. Make sure you have the Open JDK
> >> available and that Eclipse is using that one instead of the gjc.
>
> >> Then install 32 bit library dependencies for Android SDK on Fedora 11
> >> Beta.
>
> >> $yum install glibc.i686
> >> $yum install ncurses-libs.i586
> >> $yum install libstdc
> >> $yum install libstdc++.i586
> >> $yum install libzip.i586
> >> $yum install libX11.i586
> >> $yum install libXrandr.i586
>
> >> I had a lot of problems with the emulator which using SDL and got the
> >> following error:
>
> >> "SDL init failure, reason is: No available video device"
>
> >> Found a good tip to see what libs is not found:
>
> >> $cd $andoird_sdk/tools/
> >> $strace ./emulator
>
> >> It seems that the SDL couln't initialize the screen if not the libX11
> >> and libXrandr wasn't aviable.
>
> >> Next step was to get the ddms working:
>
> >> The last line of $ANDROID_SDK1.1R1/tools/ddms has a -
> >> Djava.library.path entry pointing to 32 bit eclipse libraries which
> >> couldn't be used. So I renamed the library property so it wouldn't be
> >> read and instead use the 64 bit eclipse versions.
>
> >> exec "$java_cmd" -d64 -Xmx256M $os_opts $java_debug -
> >> Djava.ext.dirs="$frameworkdir" -Djava.dummy.library.path="$libdir" -
> >> Dcom.android.ddms.bindir="$progdir" -jar "$jarpath" "$@"
>
> >> Then getting the usb to work, follow the instructions 
> >> on:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> >> The following did work at some point but isn't the prefered way to
> >> connect the android according to my 
> >> googling:https://bugzilla.redhat.com/show_bug.cgi?id=468532
>
> >> I have to start adb as root so if anyone have a solution for that I
> >> would be more than happy!
>
> >> RegardsPerty
--~--~-~--~~~---~--~~
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: Early Look Android 1.5 SDK

2009-04-14 Thread Perty

Great news!

I had a lot of trouble installing the 1.1r1 Linux version  on 64 bit
fedora 11 beta (and I think there is the same trouble for fedora 10
and other distros).

Is there any chance there will be a 64 bit package for linux?

I posted a short tutorial on
http://groups.google.com/group/android-developers/browse_thread/thread/5d16b9029724bb92/08d3a05f6179d197

For the 1.1r1 package and 64 bit  Fedora 11 beta.

Regards Per Jonsson


On 14 Apr, 01:30, Xavier Ducrohet  wrote:
> Hello developers!
>
> I'm pleased to announce the release of an early look of the Android 1.5 SDK.
>
> More information and download link 
> at:http://android-developers.blogspot.com/2009/04/getting-ready-for-andr...
>
> Have fun!
>
> Xav
> --
> Xavier Ducrohet
> Android Engineer, Google.
--~--~-~--~~~---~--~~
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] Running Android SDK 1.1 R1 on Linux 64 bit Fedora 11 RawHide

2009-04-07 Thread Perty

How to get Android SDK 1.1 R1 (android-sdk-linux_x86-1.1_r1) working
on 64 Bit Linux, Fedora 11 Beta RawHide. (this could surely be applied
to other distros as well I suppose but I have just tested the above)

Download the "eclipse-java-ganymede-SR1-linux-gtk-x86_64.tar.gz"
eclipse.org. The version from Fedora repository doesn't work due to
incompatible packages / versions. Make sure you have the Open JDK
available and that Eclipse is using that one instead of the gjc.

Then install 32 bit library dependencies for Android SDK on Fedora 11
Beta.

$yum install glibc.i686
$yum install ncurses-libs.i586
$yum install libstdc
$yum install libstdc++.i586
$yum install libzip.i586
$yum install libX11.i586
$yum install libXrandr.i586

I had a lot of problems with the emulator which using SDL and got the
following error:

"SDL init failure, reason is: No available video device"

Found a good tip to see what libs is not found:

$cd $andoird_sdk/tools/
$strace ./emulator

It seems that the SDL couln't initialize the screen if not the libX11
and libXrandr wasn't aviable.

Next step was to get the ddms working:

The last line of $ANDROID_SDK1.1R1/tools/ddms has a -
Djava.library.path entry pointing to 32 bit eclipse libraries which
couldn't be used. So I renamed the library property so it wouldn't be
read and instead use the 64 bit eclipse versions.

exec "$java_cmd" -d64 -Xmx256M $os_opts $java_debug -
Djava.ext.dirs="$frameworkdir" -Djava.dummy.library.path="$libdir" -
Dcom.android.ddms.bindir="$progdir" -jar "$jarpath" "$@"


Then getting the usb to work, follow the instructions on:
http://groups.google.com/group/android-developers/browse_thread/thread/14c6326f51116c02
http://zachoglesby.com/2009/03/android-and-fedora/

The following did work at some point but isn't the prefered way to
connect the android according to my googling:
https://bugzilla.redhat.com/show_bug.cgi?id=468532


I have to start adb as root so if anyone have a solution for that I
would be more than happy!

Regards Perty


--~--~-~--~~~---~--~~
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] Android SDK for 64 bit Linux?

2009-03-22 Thread Perty

Is there a chance that there may be a Android SDK for 64 bit distros?
I'm running Fedora 11 Alpha 64 now and have a hard time finding a
similar package that Ubuntu have "ia32-libs" as described in the
installation notes.

/Perty

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---