Share My Creation fun clinometer

Hello all,

here is my newest program. Please test it. It uses the opengl 1.7 lib.
It rotates the eye depending on the orientation sensor.
Next i want to make a widget and a liveWallpaper from it.

it would be nice to hear from you.

Harald
 

Attachments

  • Clinometer.jpg
    Clinometer.jpg
    9 KB · Views: 6,807
  • GLAuge.zip
    149 KB · Views: 1,139
Last edited:

dagnabitboy

Active Member
Licensed User
Longtime User
Haha, the eyes have it!! Very cool. Looks good and works well on my droidx. Anyone trying this should make sure they have the openGL library installed! It shows pitch and roll at the top of the screen.
 

grobi71

Member
Licensed User
Longtime User
Thanks for your reply.
Your right the opengl1.7 has to be installed.

thanks
Grobi71
 

grobi71

Member
Licensed User
Longtime User
need some help

uarg.... just tried to set a BackgroundImage, without success.
If i draw the BackgroundImage like:

in global:
Dim Bild As Bitmap

in Sub Activity_Create(FirstTime As Boolean)
Activity.Initialize("")
obj1=GLObject_Load(currentobject)
' OpenGL display setup
glsv.Initialize(glsv.RENDERMODE_WHEN_DIRTY, "glsv")
Bild.Initialize(File.DirAssets,"480x800.jpg")
Activity.AddView(glsv,0,0,Activity.Width,Activity.Height)
glsv.SetBackgroundImage(Bild)

i can see the Image, Buttons and Text but no 3D-Eye

any Idea ??

for some informations: i draw the Eye with Blender exorted it to Wings 3D exported to Directx and
converted it with Jim's converter to a .model file

best regards
Grobi71
 
Last edited:

agraham

Expert
Licensed User
Longtime User
As GL SurfaceView is derived from View it inherits the SetBackgroundImage method. However using that is likely to interfere with the OpenGL rendering as it will replace the Drawable that OpenGL is rendering on by a BackgroundDrawable based on your image. You should render any background you want in OpenGL code.
 

grobi71

Member
Licensed User
Longtime User
Hi agraham,

then i don't understand the command
SetBackgroundImage (arg0 As android.graphics.Bitmap) in the opengl
library. So i let the Background uni colored. Perhaps i will change this in the
future.
Yesterday i was in a bookstore to get a book about Android and opengl,
but they are all in english and my english is not so good.

best regards
Harald
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hallo Harald,

This is a nice idea, indeed. I like that.
I have made a few modifications in particular to the sensor routines
which can be simplified significantly. I also added a routine that
switches between sensor and manual modes. You can see the
rest when going through the code.

Das ist eine wirklich gute Idee. Das gefaellt mir.
Ich habe einiges modifiziert insbesondere die Sensor Routinen, die man
weitgehend vereinfachen kann. Auch habe ich noch eine Routine eingefuegt,
mit der man zwischen Sensorsteuerung und manueller Augenbewegung
waehlen kann. Den Rest siehst Du wenn Du Dir den Kode anschaust.

Dank Jim Brown's Pionierarbeit mit OpenGL bin ich damit etwas weitergekommen.
Dennoch ist OpenGL ein schwieriges Konzept, da man wirklich genau wissen, muss
was die Befehle und deren Reihenfolge bewirken. Literatur ueber OpenGL
im Zusammenhang mit B4A ist meines Wissens nach nicht verfuegbar.
Die meisten Beispiele im Internet beruhen auf Java, was umgesetzt werden muss.
Ich denke jedoch, dass sich die Muehe lohnt.

Alles Gute

Robert
 

Attachments

  • GLAuge.zip
    196.1 KB · Views: 515

grobi71

Member
Licensed User
Longtime User
Hallo Robert,

danke für deine Hinweise und Verbesserungen. Ja, leider gibt es die Bücher nur
für Java und in Englisch. Im Moment bin ich aufgrund meier Behinderung Rentner und habe deshalb etwas Zeit um mich auch noch mit Java zu beschäftigen.

Meine Apps sind eigentlich nur das Resultat von Langeweile.Aber ich hoffe das der eine oder andere wiedererwartend Nutzen daraus ziehen kann.

LG
Harald
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hallo Harald,

Das waren eigentlich keine Verbesserungen, vielmehr Alternativen.
Dein Kode lief einwandfrei auf meinem Sharp IS03 Android Telefon.
Ich bin sicher, dass Deine Idee fuer viele Mitglieder in diesem Forum ein Anreiz
ist.

I am sure that your concept will trigger lots of interest among numerous forum
members.

LG
Robert
 
D

Deleted member 103

Guest
Hallo Harald,

ich finde dein Beispiel wirklich sehr gut, die bewegungen sind nicht so ganz fliesend aber trotzem gut.
Ich habe an dein Beispiel eine kleine änderung gemacht, ich hoffe es gefällt dir.

I think your example really very good, the movements are not quite fluent but despite good.
I made one small change to your example, I hope you like it.


Ciao,
Filippo
 

Attachments

  • GLAuge.zip
    201.4 KB · Views: 432
  • Simson.jpg
    Simson.jpg
    33.6 KB · Views: 327

grobi71

Member
Licensed User
Longtime User
Hi Fillipo,

well done, i love it. You showed me a good way to add a background image.

Harald

Klasse genial usw. So kann man eigentlich recht einfach ein Hintergrundbild
hinzufügen. Da wäre ich wohl niedrauf gekommen.

LG
Harald
 
D

Deleted member 103

Guest
Hi Harald,

wo kann man die Hintergrundfarbe von Blau auf Transparent ändern?


where you can change the background color from blue to transparent?
 

grobi71

Member
Licensed User
Longtime User
Hallo Filippo,

the bachground can be changed in Sub glsv_Draw(gl As GL1)

the command gl.glClearColor(r,g,b,alpha) clears the view and fill with given color

i don't know if the sequence of RGB is the right one. alpha is the last parameter


in der Routine Sub glsv_Draw(gl As GL1) im command gl.glClearColor(r,g,b,alpha)

die reihenfolge von RGB weiss ich jetzt gerade nicht auswendig. Probiers mal.
Alpha ist jedoch der vierte Parameter
LG
Harald
 

alfcen

Well-Known Member
Licensed User
Longtime User
Ciao Filippo!

Brilliant and funny, just like the guy in your Huetchenspiel. Now Mr Simpson needs another moving eye :)
Just a few changes:

We should get rid of NumberFormat in:
B4X:
Sub Sensor_SensorChanged (Values() As Float)
   rotX = 28 + Values(1)
   rotY = -48.5 + Values(2)
   glsv.RequestRender
End Sub

Also relocated the buttons to the designer layout and made the glsv view transparent.
 
D

Deleted member 103

Guest
Ciao Robert,

leider wird das hintergrund nicht transparent.

Unfortunately, the background is not transparent.

PS. vielen Dank für:
Brilliant and funny, just like the guy in your Huetchenspiel

Deine Programme sind aber um einiges besser als meine!
 

Attachments

  • Simson.jpg
    Simson.jpg
    34.1 KB · Views: 285

grobi71

Member
Licensed User
Longtime User
Hallo Robert. :sign0013:

i think we had to ask agraham for that. i added some improvements from the users and made some little changes to the eye and the background

warum der Hintergrund nicht transparent ist weiß ich leide rnicht, da müssen wir mal agraham oder alfcen fragen. Ich habe mal ein wenig glanz zum Auge hinzugefügt und ein anderes Hintergrundbild gewählt. Die meisten Verbesserungsvorschläge sind berücksichtigt.
Ein Click auf das Auge setzt es auf 0 zurück

Gruß
Harald
 

Attachments

  • clino.jpg
    clino.jpg
    8 KB · Views: 326
  • Clino2.zip
    370.6 KB · Views: 442
Last edited:

alfcen

Well-Known Member
Licensed User
Longtime User
Hallo Harald,

So far my attempts failed. The glsv view does not appear to assume transparency by applying conventional methods to the view itself.
The solution lies somewhere in OpenGL provided that Android's implementation of OpenGL can do it at all. For the time being, it looks really good on a black activity.
By the way, that skull ain't bad at all :)

Bisher schlugen meine Versuche fehl. Das glsv Objekt scheint keine Transparenz mit herkoemmlichen Befehlen anzunehmen. Die Loesung liegt wohl irgendwo in OpenGL, vorausgesetzt Android's Implementation kann das ueberhaupt bewerkstelligen. Vorlaeufig sieht das ja richtig gut auf schwarzem Hintergrund aus.
Nebenbei bemerkt, der Schaedel ist gar nicht uebel :)

Robert
 

grobi71

Member
Licensed User
Longtime User
Hallo Robert,

i'm just trieing it also without success. In another thread i asked agraham if he has an idea.Anyway there is a new Version with additional two balls one horizontal and one vertical. But i don't think it's a good idea to release all. i will release the result at the end in this tread. I tried to make a wallpaper out of it, but opengl is not supportedyet. i found a glwallpaper.jar in the internet and will have a look to that.

ich habe es auch noch nicht geschafft. Es wird wohl an der Library liegen. Ich habe in einem anderen thread agraham kontaktiert ob er eine Idee hat.
Momentan versuche ich ein live Wallpaper daraus zu machen aber opengl scheint nicht supported zu sein.

Harald
 

Enano123

New Member
Licensed User
Longtime User
¿with what program you made the "auge.model"?

Sorry for my noob question, im starting in this :sign0013:
 
Top