B4A Library OpenGL 2.0 library

Discussion in 'Additional libraries, classes and official updates' started by agraham, May 20, 2011.

  1. agraham

    agraham Expert Licensed User

    Version 1.4 now posted has Matrix2.SetLookAtM() added and corrected the typo of gActiveTexture(), now glActiveTexture().

    I've no idea about OpenGL2 differences between devices but my Motorola Xoom shows an ape or monkey face!
     
  2. GDO

    GDO Member Licensed User

    Thank you !

    Do you know, why my apk is result.apk and not bitmap.apk ?
    (I guess is not the right place to ask about that but my program is in this thread).
     
  3. agraham

    agraham Expert Licensed User

    You probably got a space or other invalid character in the project name. In this case the "-" I think.
     
  4. GDO

    GDO Member Licensed User

    OK.
    Thank you.
     
  5. Informatix

    Informatix Expert Licensed User

    In landscape mode, the monkey does not show on some of my devices (e.g. Nexus 7). In portrait mode, all is OK.
     
  6. agraham

    agraham Expert Licensed User

    I didn't try that as my Xoom is locked in a portrait stand. Landscape is just a grey background when I take it out and rotate it.
     
  7. GDO

    GDO Member Licensed User

    Thanks Agraham and Informatix for your answer.

    My Asus got a keyboard and the program runs in landscape mode.

    I have to manage the reload of the bitmap in this case.

    Thank you very much for your help.
     
  8. GDO

    GDO Member Licensed User

    Is this better ?
     

    Attached Files:

  9. agraham

    agraham Expert Licensed User

    No. The problem is something to do with ratio. If I fix it at 0.68 then it works in landscape (distorted) as well as portrait.
     
  10. GDO

    GDO Member Licensed User

    I think the ratio trouble could be solved by changing that :
    #FullScreen: False ------------> True
    #IncludeTitle: True -----------> False
    Am I right ?
     
  11. agraham

    agraham Expert Licensed User

    I don't know. I haven't looked closely at it.
     
  12. GDO

    GDO Member Licensed User

    Hello,

    The trouble was about ratio and vertex shader, as you said.
    I fixed it.

    Thanks.
     
  13. GDO

    GDO Member Licensed User

    Hello,

    Could you please, change these 2 functions :

    glCompressedTexImage2D
    glCompressedTexSubImage2D


    " data As java.nio.Buffer " should be replace by the same type like you did for gltexImage2D

    Thank you.
     
  14. agraham

    agraham Expert Licensed User

    I actually did nothing for glTexImage2D and glTexSubImage2Dto let them accept a Bitmap parameter, a class call GLUtils provide those methods.

    Did you want to pass a Bitmap to glCompressedTexImage2D and glCompressedTexSubImage2D? From what I can see they accept an image in some sort of compressed format. I am afraid I do not know enough about OpenGL or Android Bitmap handling for that matter, to even guess how to implement this. If anyone can explain what is needed I'm willing to have a go.
     
  15. GDO

    GDO Member Licensed User

    I wrote glTexImage2D and glTexSubImage2Dto but I thought to glBufferData.

    I wanted to pass a pointer on bytes to glCompressedTexImage2D and glCompressedTexSubImage2D and I thought opengl will manage it.

    I don't know how to generate ppm files (ericson can convert ppm to ktx but my ppm files (from Paint Shop Pro X2) are not OK).

    And last but not least, I need to generate compressed files inside my program (for shadow maps for example) and I don't know how.

    So, for the moment, I will not use compressed textures.

    Sorry for my last post.

    :signOops:
     
  16. PhilN

    PhilN Member Licensed User

    Hi Graham, I have a project in which I am trying to implement motion sensing. That is using the 3-axis accelerometer, gyro and magnetometer data, applying sensor fusion to integrate the data (using Kalman filter techniques) to create a 3D virtual motion path that closely resembles the motion of the initiating device, my Samsung Galaxy SII. I was so very excited to see that you wrote a wrapper for OpenGL for B4A. I immediately downloaded and installed a few examples and used Jim Browns ModelUtil to convert a few objects and tried it out. Great success! I however would like to use the glVertex and glBegin and glEnd functions. This would really save me as I need to draw countless points and lines as you can imagine. Would you be so kind as to include these functions in your OpenGL2 library.
    :sign0085:
    Please... Please... Please...
     
  17. Informatix

    Informatix Expert Licensed User

    Agraham cannot implement what does not exist in OpenGL ES (please note the ES). Android does not embed a full featured OpenGL.
     
  18. Informatix

    Informatix Expert Licensed User

    If that may help, an user made lately a port of jPCT-AE, which is a 3D game engine. That's probably better to use it than doing all by yourself.
     
  19. PhilN

    PhilN Member Licensed User

    Thanks. Informatix. I was unaware of this. :sign0104:
     
  20. John D.

    John D. Member Licensed User

    Thank you for this library, Mr. Graham. I've left a tip in the jar for you.

    Being new to all this, I tried running the demo included in the zip and ran into a few problems, most likely due to my blithering ignorance. I've posted a few questions in the questions forum, could you please have a look if you get some time?

    Thanks

    --John--
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice