OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

osgAndroid: Library for develop OSG applications in Android

Goto page 1, 2  Next
 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Announcement [ANN]
View previous topic :: View next topic  
Author Message
Rafa Gaitan
Guest





PostPosted: Thu Aug 30, 2012 12:01 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi everybody,

I'm glad to announce osgAndroid (OpenSceneGraph for Android). It consists in a set of Java/JNI wrappers of OpenSceneGraph and some helper classes to easily develop OSG applications in Android.


The code repository is hosted in Gitorious:


https://gitorious.org/osgandroid


I still don't have a complete documentation, but some quick start guidelines can be found here:


https://gitorious.org/osgandroid/pages/Home

The osgAndroid project has been initially funded by:

IRTIC(http://smagris3.uv.es/irtic/)
AI2(http://www.ai2.upv.es)
MirageTechnologies S.L.(http://www.mirage-tech.com).

But we all agreed in open the source code and try to make the life easier to all osg developers that want to migrate applications to Android. The project was initially developed with AR applications in mind, so you will not find too many interaction tools there, and of course has some limitations, but you can load and display a model with only a few lines of code:


... 
mView = new Viewer(this);
mView.init(false, 16, Cool;
mView.setSceneData(ReadFile.readNodeFile("/sdcard/axes.ive"));
mView.setDefaultSettings();
setContentView(mView);...


Some usage samples can also be found in the code, such as how to use the Android device Camera with an OSG scene with transparent background or how to mix osgAndroid and native code in an Android Activity, and much more will be added.


I would also like to announce the project in the community news section of the new site (openscenegraph.com), is it possible?


I really hope this will be useful to the community, and of course feel free to contribute!


Cheers,
Rafa





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Jan Ciger
Guest





PostPosted: Thu Aug 30, 2012 12:13 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

On Thu, Aug 30, 2012 at 2:02 PM, Rafa Gaitan < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi everybody,

I'm glad to announce osgAndroid (OpenSceneGraph for Android). It consists in a set of Java/JNI wrappers of OpenSceneGraph and some helper classes to easily develop OSG applications in Android.


...
 
Quote:
But we all agreed in open the source code and try to make the life easier to all osg developers that want to migrate applications to Android. The project was initially developed with AR applications in mind, so you will not find too many interaction tools there, and of course has some limitations, but you can load and display a model with only a few lines of code:

Excellent!

Thanks for not keeping this proprietary, it will certainly make it easier to get going on Android.

Jan

------------------
Post generated by Mail2Forum
Back to top
Jordi Torres
Guest





PostPosted: Thu Aug 30, 2012 12:13 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Rafa,

First of all congratulations, at the end you were able to opensource the project!
Quote:


I would also like to announce the project in the community news section of the new site (openscenegraph.com), is it possible?



You have now publisher rights in the new web, so feel free to add a Community New in the openscenegraph.com. I think you might modify the page http://www.openscenegraph.com/index.php/community/projects written by Paul Martz to add the new project.

Cheers.

 
Quote:

I really hope this will be useful to the community, and of course feel free to contribute!


Cheers,
Rafa





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es

------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Thu Aug 30, 2012 12:20 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

2012/8/30 Jan Ciger < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:

On Thu, Aug 30, 2012 at 2:02 PM, Rafa Gaitan < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi everybody,

I'm glad to announce osgAndroid (OpenSceneGraph for Android). It consists in a set of Java/JNI wrappers of OpenSceneGraph and some helper classes to easily develop OSG applications in Android.



...
 
Quote:
But we all agreed in open the source code and try to make the life easier to all osg developers that want to migrate applications to Android. The project was initially developed with AR applications in mind, so you will not find too many interaction tools there, and of course has some limitations, but you can load and display a model with only a few lines of code:


Excellent!

Thanks for not keeping this proprietary, it will certainly make it easier to get going on Android.




Thank you Jan!, I have some AR examples that I want also release Smile in the next days. If you find any problem using it feel free to tell me. 


I hope Robert does not mind that we use the osg-users list for these things.


Rafa.


 
Quote:

Jan



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Thu Aug 30, 2012 12:23 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Jordi,

2012/8/30 Jordi Torres < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hi Rafa,

First of all congratulations, at the end you were able to opensource the project!


Thank you!, you are also a contributor so thank you to you too!.
 
Quote:
Quote:


I would also like to announce the project in the community news section of the new site (openscenegraph.com), is it possible?




You have now publisher rights in the new web, so feel free to add a Community New in the openscenegraph.com. I think you might modify the page http://www.openscenegraph.com/index.php/community/projects written by Paul Martz to add the new project.




Perfect, I will start there and I will try not to make a mess with the page Smile.


Rafa.


 
Quote:

Cheers.

 
Quote:

I really hope this will be useful to the community, and of course feel free to contribute!


Cheers,
Rafa





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Thu Aug 30, 2012 1:37 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

On Thu, 2012-08-30 at 14:02 +0200, Rafa Gaitan wrote:
Quote:
Hi everybody,


I'm glad to announce osgAndroid (OpenSceneGraph for Android). It
consists in a set of Java/JNI wrappers of OpenSceneGraph and some
helper classes to easily develop OSG applications in Android.

Just out of curiosity, does this avoid the need to "enable untrusted
software sources" or whatever it is Android calls it?

Quote:

The code repository is hosted in Gitorious:


https://gitorious.org/osgandroid


I still don't have a complete documentation, but some
quick start guidelines can be found here:


https://gitorious.org/osgandroid/pages/Home

The osgAndroid project has been initially funded by:

IRTIC(http://smagris3.uv.es/irtic/)
AI2(http://www.ai2.upv.es)
MirageTechnologies S.L.(http://www.mirage-tech.com).


But we all agreed in open the source code and try to make the life
easier to all osg developers that want to migrate applications to
Android. The project was initially developed with AR applications in
mind, so you will not find too many interaction tools there, and of
course has some limitations, but you can load and display a model with
only a few lines of code:


...
mView = new Viewer(this);
mView.init(false, 16, Cool;
mView.setSceneData(ReadFile.readNodeFile("/sdcard/axes.ive"));
mView.setDefaultSettings();
setContentView(mView);
...


Some usage samples can also be found in the code, such as how to use
the Android device Camera with an OSG scene with transparent
background or how to mix osgAndroid and native code in an Android
Activity, and much more will be added.


I would also like to announce the project in the community news
section of the new site (openscenegraph.com), is it possible?


I really hope this will be useful to the community, and of course feel
free to contribute!


Cheers,
Rafa





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com






------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Thu Aug 30, 2012 2:25 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Jeremy,

2012/8/30 Jeremy Moles < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
On Thu, 2012-08-30 at 14:02 +0200, Rafa Gaitan wrote:
Quote:
Hi everybody,


I'm glad to announce osgAndroid (OpenSceneGraph for Android). It
consists in a set of Java/JNI wrappers of OpenSceneGraph and some
helper classes to easily develop OSG applications in Android.


Just out of curiosity, does this avoid the need to "enable untrusted
software sources" or whatever it is Android calls it?


Currently is only a library that you should download, compile and use it to develop your own Applications (.apk). It is not accepted as a downloadable SDK in the AVDManager Smile (yet?, maybe in the future)


I think that "enable untrusted software sources" is needed to install any application outside the Google Play store, i.e, any (.apk) application that you want to install by yourself. If you build an application with osgAndroid and it is accepted in the Google Play store then, AFAIK, then it will be distributed through a trusted software source.


Maybe other Android developers with more experience in deploying applications could give more info here.


Rafa.


 
Quote:

Quote:

The code repository is hosted in Gitorious:


https://gitorious.org/osgandroid


I still don't have a complete documentation, but some
quick start guidelines can be found here:


https://gitorious.org/osgandroid/pages/Home

The osgAndroid project has been initially funded by:

IRTIC(http://smagris3.uv.es/irtic/)
AI2(http://www.ai2.upv.es)
MirageTechnologies S.L.(http://www.mirage-tech.com).


But we all agreed in open the source code and try to make the life
easier to all osg developers that want to migrate applications to
Android. The project was initially developed with AR applications in
mind, so you will not find too many interaction tools there, and of
course has some limitations, but you can load and display a model with
only a few lines of code:


...
mView = new Viewer(this);
mView.init(false, 16, Cool;
mView.setSceneData(ReadFile.readNodeFile("/sdcard/axes.ive"));
mView.setDefaultSettings();
setContentView(mView);
...


Some usage samples can also be found in the code, such as how to use
the Android device Camera with an OSG scene with transparent
background or how to mix osgAndroid and native code in an Android
Activity, and much more will be added.


I would also like to announce the project in the community news
section of the new site (openscenegraph.com), is it possible?


I really hope this will be useful to the community, and of course feel
free to contribute!


Cheers,
Rafa





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com



Quote:
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Jan Ciger
Guest





PostPosted: Wed Sep 05, 2012 2:56 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hello Rafael,

I have tried your osgAndroid library, it does indeed work for me after fixing few details, such as incorrect project references in Eclipse.

However, I see a weird bug. I have modified the OSGOverlayCamera example to load three .ive files - a cube, floor plane and a monkey mesh (Suzanne from Blender). That works ok. However, as soon as I use MatrixTransforms to move things around or to scale them, it goes wrong. E.g. setting scale factor to 0.1 makes my geometry reliably vanish (4x4 scaling matrix with 0.1 on diagonal and 1 in the last element). Using scaling coefficient of 0.2 doesn't make it vanish, but doesn't scale it neither ?!

Then I wanted to swap the axes, because my geometry is y-up. So I have used this matrix:

Matrix(1, 0, 0, 0,
           0, 0, 1, 0,
           0, -1, 0, 0,
           0, 0, 0, 1);

However, if I use this, add the geometry as children to this matrix and set the matrix as scene data to the viewer, the geometry "explodes" (it is stretched out into infinity) - as if division by zero was happening somewhere or the matrix was singular (it obviously isn't).

Of course, the same geometry configuration with the same matrices is working just fine if I add the matching C++ code to the native OSG example from the OSG source. What is going on? Some sort of JNI type conversion issue? I am not a JNI expert, so I have no clue there ...

For the record, I am testing this on an Acer Iconia A500 tablet, with the Ice Cream Sandwich. It has Tegra 2 (without Neon, so using armeabi ABI) chipset.

What is going on here?

Regards,

Jan

------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Wed Sep 05, 2012 3:14 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Jan,

I'm glad you are using it, I'm answering you below.

2012/9/5 Jan Ciger < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hello Rafael,

I have tried your osgAndroid library, it does indeed work for me after fixing few details, such as incorrect project references in Eclipse.


Nice to hear that worked for you, Could you post me the changes?, If the changes are related to the Android.mk files, this is something you need to change in order to build against OSG (maybe I need to add the note to the wiki). If are related to the eclipse projects I will be happy to fix them Smile.
 
Quote:

However, I see a weird bug. I have modified the OSGOverlayCamera example to load three .ive files - a cube, floor plane and a monkey mesh (Suzanne from Blender). That works ok. However, as soon as I use MatrixTransforms to move things around or to scale them, it goes wrong. E.g. setting scale factor to 0.1 makes my geometry reliably vanish (4x4 scaling matrix with 0.1 on diagonal and 1 in the last element). Using scaling coefficient of 0.2 doesn't make it vanish, but doesn't scale it neither ?!

Then I wanted to swap the axes, because my geometry is y-up. So I have used this matrix:

Matrix(1, 0, 0, 0,
           0, 0, 1, 0,
           0, -1, 0, 0,
           0, 0, 0, 1);

However, if I use this, add the geometry as children to this matrix and set the matrix as scene data to the viewer, the geometry "explodes" (it is stretched out into infinity) - as if division by zero was happening somewhere or the matrix was singular (it obviously isn't).

Of course, the same geometry configuration with the same matrices is working just fine if I add the matching C++ code to the native OSG example from the OSG source. What is going on? Some sort of JNI type conversion issue? I am not a JNI expert, so I have no clue there ...

For the record, I am testing this on an Acer Iconia A500 tablet, with the Ice Cream Sandwich. It has Tegra 2 (without Neon, so using armeabi ABI) chipset.

What is going on here?


I've been using MatrixTransform for AR applications and I don't remember that kind of issues, but JNI stuff is tricky and maybe there is a bug there. Sometimes if you don't keep correctly the reference count of OSG objects between Java and C++ weird things happen.


Could you post the code or a simple example so I could check it on my side? Anyway I'm going to test it in order to replicate your problem.


I have a Samsung Galaxy S with Android 2.3.6.



Regards,
Rafa.


 
Quote:

Regards,

Jan

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Wed Sep 05, 2012 4:41 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Jan,

I had found one fatal bug, that probably was the problem. It was the typical copy - paste problem! :S. When doing postMult or preMult, I was using the same origin matrix to do the computation, so weird things were happening.


Fixes and some improvements to the osgcamera example (now is landscape and with correct aspect ratio) es checked in and pushed to the repository. I have also added a modified the example using three MatrixTransform, I think in the similar way you described.


I didn't spotted this before, because in AR applications we were setting the matrix directly using .set method.


Thank you for spotting that bug!, Anyway tell me if things work for you or maybe there is another hidden problem there.


Cheers,
Rafa.



2012/9/5 Rafa Gaitan < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hi Jan,

I'm glad you are using it, I'm answering you below.

2012/9/5 Jan Ciger < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hello Rafael,

I have tried your osgAndroid library, it does indeed work for me after fixing few details, such as incorrect project references in Eclipse.



Nice to hear that worked for you, Could you post me the changes?, If the changes are related to the Android.mk files, this is something you need to change in order to build against OSG (maybe I need to add the note to the wiki). If are related to the eclipse projects I will be happy to fix them Smile.
 
Quote:

However, I see a weird bug. I have modified the OSGOverlayCamera example to load three .ive files - a cube, floor plane and a monkey mesh (Suzanne from Blender). That works ok. However, as soon as I use MatrixTransforms to move things around or to scale them, it goes wrong. E.g. setting scale factor to 0.1 makes my geometry reliably vanish (4x4 scaling matrix with 0.1 on diagonal and 1 in the last element). Using scaling coefficient of 0.2 doesn't make it vanish, but doesn't scale it neither ?!

Then I wanted to swap the axes, because my geometry is y-up. So I have used this matrix:

Matrix(1, 0, 0, 0,
           0, 0, 1, 0,
           0, -1, 0, 0,
           0, 0, 0, 1);

However, if I use this, add the geometry as children to this matrix and set the matrix as scene data to the viewer, the geometry "explodes" (it is stretched out into infinity) - as if division by zero was happening somewhere or the matrix was singular (it obviously isn't).

Of course, the same geometry configuration with the same matrices is working just fine if I add the matching C++ code to the native OSG example from the OSG source. What is going on? Some sort of JNI type conversion issue? I am not a JNI expert, so I have no clue there ...

For the record, I am testing this on an Acer Iconia A500 tablet, with the Ice Cream Sandwich. It has Tegra 2 (without Neon, so using armeabi ABI) chipset.

What is going on here?



I've been using MatrixTransform for AR applications and I don't remember that kind of issues, but JNI stuff is tricky and maybe there is a bug there. Sometimes if you don't keep correctly the reference count of OSG objects between Java and C++ weird things happen.


Could you post the code or a simple example so I could check it on my side? Anyway I'm going to test it in order to replicate your problem.


I have a Samsung Galaxy S with Android 2.3.6.



Regards,
Rafa.


 
Quote:

Regards,

Jan

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com







--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Jan Ciger
Guest





PostPosted: Wed Sep 05, 2012 6:48 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

On 09/05/2012 05:15 PM, Rafa Gaitan wrote:
Quote:
Hi Jan,

I'm glad you are using it, I'm answering you below.

2012/9/5 Jan Ciger < <mailto:>>

Hello Rafael,

I have tried your osgAndroid library, it does indeed work for me
after fixing few details, such as incorrect project references in
Eclipse.


Nice to hear that worked for you, Could you post me the changes?, If the
changes are related to the Android.mk files, this is something you need
to change in order to build against OSG (maybe I need to add the note to
the wiki). If are related to the eclipse projects I will be happy to fix
them Smile.

I think that the name of the project referenced by example is wrong - it
doesn't install the JNI libs with the Camera example unless you set the
projects are referenced from the example.

I will check what other changes I had to make, but it wasn't much or it
was specific to my setup.

Quote:


I've been using MatrixTransform for AR applications and I don't remember
that kind of issues, but JNI stuff is tricky and maybe there is a bug
there. Sometimes if you don't keep correctly the reference count of OSG
objects between Java and C++ weird things happen.

Could you post the code or a simple example so I could check it on my
side? Anyway I'm going to test it in order to replicate your problem.

Sure, I can do that. The code is a simple mod of your example. I will
send you a follow-up e-mail with the code and the other changes tomorrow
when I am back at the office.

Regards,

Jan


------------------
Post generated by Mail2Forum
Back to top
Jan Ciger
Guest





PostPosted: Wed Sep 05, 2012 6:53 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

On 09/05/2012 06:41 PM, Rafa Gaitan wrote:
Quote:
Hi Jan,

I had found one fatal bug, that probably was the problem. It was
the typical copy - paste problem! :S. When doing postMult or preMult, I
was using the same origin matrix to do the computation, so weird things
were happening.

Fixes and some improvements to the osgcamera example (now is landscape
and with correct aspect ratio) es checked in and pushed to the
repository. I have also added a modified the example using three
MatrixTransform, I think in the similar way you described.

I didn't spotted this before, because in AR applications we were setting
the matrix directly using .set method.

Thank you for spotting that bug!, Anyway tell me if things work for you
or maybe there is another hidden problem there.

Ah, that is indeed an oops :-p

I will check tomorrow when I am back at the office. Hopefully that will
fix it. However I am setting the matrices using setMatrix() too, so
perhaps there is yet another issue in there.

BTW, re camera - it was crashing on my tablet, because the camera cannot
support the preview resolution you were asking for (the full screen
resolution). A better way to do it is to ask for the preferred
resolution and then rescale that to fit the screen. I think that was one
of the things I had to fix otherwise the camera example was crashing on
start.

Regards,

Jan


------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Wed Sep 05, 2012 9:28 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Jan,

2012/9/5 Jan Ciger < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
On 09/05/2012 06:41 PM, Rafa Gaitan wrote:
Quote:
Hi Jan,

I had found one fatal bug, that probably was the problem. It was
the typical copy - paste problem! :S. When doing postMult or preMult, I
was using the same origin matrix to do the computation, so weird things
were happening.

Fixes and some improvements to the osgcamera example (now is landscape
and with correct aspect ratio) es checked in and pushed to the
repository. I have also added a modified the example using three
MatrixTransform, I think in the similar way you described.

I didn't spotted this before, because in AR applications we were setting
the matrix directly using .set method.

Thank you for spotting that bug!, Anyway tell me if things work for you
or maybe there is another hidden problem there.


Ah, that is indeed an oops :-p

I will check tomorrow when I am back at the office. Hopefully that will fix it. However I am setting the matrices using setMatrix() too, so perhaps there is yet another issue in there.


Thank you, If it gives you any problem then send me the modified example and I will try to reproduce it.
 
Quote:

BTW, re camera - it was crashing on my tablet, because the camera cannot support the preview resolution you were asking for (the full screen resolution). A better way to do it is to ask for the preferred resolution and then rescale that to fit the screen. I think that was one of the things I had to fix otherwise the camera example was crashing on start.


I've also checked in changes regarding the camera resolution I hope these changes will also fix the problems on your side.




Thank you for testing!
Rafa.


Quote:


Regards,

Jan
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Jan Ciger
Guest





PostPosted: Thu Sep 06, 2012 11:41 am    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hello Rafael,

On Wed, Sep 5, 2012 at 11:29 PM, Rafa Gaitan < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Jan,



Thank you, If it gives you any problem then send me the modified example and I will try to reproduce it.


I have updated my code and the bug is still there.

You can get my modified example here:
https://dl.dropbox.com/u/6822332/org.openscenegraph.osgcamera.zip

The data files are here (just unpack the folder to /sdcard on your device, it looks for files /sdcard/osg/*.ive):
https://dl.dropbox.com/u/6822332/osg.zip
 



Quote:
I've also checked in changes regarding the camera resolution I hope these changes will also fix the problems on your side.


Yes, that fixed the camera-related crash.




BTW, there is a syntax error in  org.openscenegraph.android/jni/JNIosgViewer.cpp:

@@ -138,7 +138,7 @@ JNIEXPORT void JNICALL Java_org_openscenegraph_osg_viewer_Viewer_nativeSetUpView
 
 JNIEXPORT void JNICALL Java_org_openscenegraph_osg_viewer_Viewer_nativeSetViewport(JNIEnv *, jclass, jlong cptr, jint x, jint y, jint width, jint height)
 {
-    osgViewer::Viewer *v = reinterpret_cast<osgViewer::Viewer::Viewer*> (cptr);
+    osgViewer::Viewer *v = reinterpret_cast<osgViewer::Viewer*> (cptr);
     if (v == NULL)
         return;
     v->getEventQueue()->windowResize(x, y, width, height);


The above makes it actually compile with the latest NDK from Google. You may also want to raise the minimum SDK level to 8 or 9 in the manifests, because Lint is complaining about functions being used that are not available in the old SDK.

Jan

------------------
Post generated by Mail2Forum
Back to top
Rafa Gaitan
Guest





PostPosted: Thu Sep 06, 2012 3:36 pm    Post subject:
osgAndroid: Library for develop OSG applications in Android
Reply with quote

Hi Jan,

2012/9/6 Jan Ciger < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hello Rafael,

On Wed, Sep 5, 2012 at 11:29 PM, Rafa Gaitan < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Jan,



Thank you, If it gives you any problem then send me the modified example and I will try to reproduce it.



I have updated my code and the bug is still there.

You can get my modified example here:
https://dl.dropbox.com/u/6822332/org.openscenegraph.osgcamera.zip

The data files are here (just unpack the folder to /sdcard on your device, it looks for files /sdcard/osg/*.ive):
https://dl.dropbox.com/u/6822332/osg.zip
 




Thank you, there is indeed a bug there :S. I was able to reproduce it.  I have also replicated it in native and it worked as expected, so something is happening in the jni conversion part. I'm debugging now and I will keep you informed.
 
Quote:



Quote:
I've also checked in changes regarding the camera resolution I hope these changes will also fix the problems on your side.



Yes, that fixed the camera-related crash.




Perfect!
 
Quote:




BTW, there is a syntax error in  org.openscenegraph.android/jni/JNIosgViewer.cpp:

@@ -138,7 +138,7 @@ JNIEXPORT void JNICALL Java_org_openscenegraph_osg_viewer_Viewer_nativeSetUpView
 
 JNIEXPORT void JNICALL Java_org_openscenegraph_osg_viewer_Viewer_nativeSetViewport(JNIEnv *, jclass, jlong cptr, jint x, jint y, jint width, jint height)
 {
-    osgViewer::Viewer *v = reinterpret_cast<osgViewer::Viewer::Viewer*> (cptr);
+    osgViewer::Viewer *v = reinterpret_cast<osgViewer::Viewer*> (cptr);
     if (v == NULL)
         return;
     v->getEventQueue()->windowResize(x, y, width, height);
The above makes it actually compile with the latest NDK from Google. You may also want to raise the minimum SDK level to 8 or 9 in the manifests, because Lint is complaining about functions being used that are not available in the old SDK.


Fixed and checked in the repository, thank you! 


Maybe we should establish a submission protocol. I think git and gitorious has something to easily merge changes from different clones. Something called merge request, but I'm pretty new in GIT and I don't have clear the complete process.


Regards,
Rafa.




 
Quote:


Jan

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Announcement [ANN] All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Building OSG for Android -- Windowing... bwhaines Build system [build] 4 Sun Apr 23, 2017 2:01 am View latest post
No new posts OSG + Qt on Android Treazy General [3rdparty] 2 Fri Mar 31, 2017 10:44 pm View latest post
No new posts Free Android game based on OSG & ... kornerr Announcement [ANN] 1 Fri Feb 03, 2017 1:56 pm View latest post
No new posts [A little bit off topic] A simple gra... Andrew Lowe General 4 Sun Nov 13, 2016 3:44 am View latest post
No new posts QVR: Virtual Reality library that sup... marlam General [3rdparty] 2 Thu Nov 10, 2016 9:55 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP