Java Question LG Optimus Real 3D library problems

geocomputing

Member
Licensed User
Longtime User
Hi,

I've been trying to do a first attempt at a library to turn on/off the parallax barrier on an LG Optimus 3D to do 3D side by side graphics. I've a few problems and would be grateful for any advice. The questions are below and I've put my Java code below them:

1) The Real3D constructor requires a surface holder, which would normally be got from getHolder(), but that doesn't work in my code because I want to use the B4A imageview holder. Is it possible to get the surfaceholder for the imageview to pass to my library function?

2) Apparently the LG real3d.jar file is stubbed. I think Erel mentioned in a different post that a wrapper would be needed. I'm not sure how to implement that in a B4A library, so wondered if that's being achieved in my code or if I need to do something else.

3) I'm manually adding relevant uses-feature and uses-library lines to the manifest under B4A. Is it possible to get the library to do that for me?

Sorry if these seem simple questions. I've managed to do a Java app that turns on the parallax barrier, but would really like to be able to do it in B4A :)

Many thanks,

Andrew. :sign0085:


import android.view.SurfaceHolder;
//import android.view.SurfaceView;

@ShortName("Real3D")
@Author("GeocomputingUK")
@Version(1f)

public class real3d
{

private Real3D mReal3D;
private Real3DInfo ss_info=new Real3DInfo(true, Real3D.REAL3D_TYPE_SS, 0);
private Real3DInfo none_info=new Real3DInfo(true, Real3D.REAL3D_TYPE_NONE, 0);

public void on(SurfaceHolder sh)
{
mReal3D = new Real3D(sh);
mReal3D.setReal3DInfo(ss_info);
}

public void off(SurfaceHolder sh)
{
mReal3D = new Real3D(sh);
mReal3D.setReal3DInfo(none_info);
}

}
 

agraham

Expert
Licensed User
Longtime User
Is it possible to get the surfaceholder for the imageview to pass to my library function?
No. An B4A ImageView is based on an Android ImageView which is not a SurfaceView and so doesn't have a holder. You will need to make an appropriate SurfaceView available as a displayable view in Basic4android like I did with GLSurfaceView in my OpenGL libraries.

Apparently the LG real3d.jar file is stubbed.
Explain "stubbed" please.

I'm manually adding relevant uses-feature and uses-library lines to the manifest under B4A. Is it possible to get the library to do that for me?
No. You might be able to modify your AndroidManifest-template.xml or you will need to use the Project -> Do Not Modify Manifest File option and edit it yourself.
 

geocomputing

Member
Licensed User
Longtime User
Hi,

Thanks for the quick reply. I was hoping to do it without creating a new component, but what you say confirms my suspicion that it isn't so easy. I've downloaded your camera library code too, which is very useful, so hopefully I should get it working. If so I'll post it here.

By stubbed I meant that the real3d SDK jar only has a java interface to aid compiling, the full functionality only being in the full jar in the emulator and device. Hopefully that won't be a problem as I've added it to the project as an external jar.

Thanks for the advice :)

Best wishes,

Andrew.
 

helderbm

New Member
Licensed User
Longtime User
3d

Hello,

I was wondering, did you get the 3d working?

Best Reagards
Helder Moreira
 

mistermentality

Active Member
Licensed User
Longtime User
Hello,

I was wondering, did you get the 3d working?

Best Reagards
Helder Moreira

I was wondering the answer to this too, as I have an Optimus 3D and would love to be able to program some 3D apps if a library for B4A was available in the future but I'm not advanced enough to write libraries unfortunately.

Dave
 
Top