Git Product home page Git Product logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Look at how Scene.java works. Min3D uses some coding conventions that are not 
as you learned it in your SCJP-classes ;) It's more related to action script 
where there are explicit getters and setters available.

scene.backgroundTransparent(true); Should do the trick.

(I would vote to change Min3D to use getBackgroundTransparent() and 
setBackgroundTransparent(boolean b) btw.)

Original comment by [email protected] on 18 Jan 2011 at 6:20

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
I'm also trying to get background transparency to no avail.
Changing the ExampleInsideLayout initScene() to:
        scene.lights().add(new Light());

        scene.backgroundColor().setAll(0xff444444);
        scene.backgroundTransparent(true);
        _cube = new Box(1,1,1);

should surely have made it transparent, but instead it just renders on a black 
background instead of the background colour. To test this I added backgrounds 
to R.drawable.listActivity (the root) and to the LinearLayout across the middle 
of the layout.

Is there a way to let the backdrop texture show through? It's what we need in 
my game.

Thanks for any help!

Original comment by [email protected] on 20 Jan 2011 at 10:20

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Hi, I've added a 'recipe' demonstrating transparency in 
min3dSampleProject1/ExampleTransparentGlSurface.java.

For device compatibility reasons, I'm reluctant to create the functionality for 
transparency thru a single simple method call, but hopefully this will suffice.

BTW, the Scene.backgroundTransparent() getter and setter got removed, since its 
name was a little misleading and it didn't add any useful functionality on its 
own.

Original comment by [email protected] on 21 Feb 2011 at 6:03

  • Changed state: Fixed

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Greetings, I have been attempting to implement a translucent glsurfaceview over 
an image background for a while now without success.  I'd also like a few 
widgets (buttons, textviews, etc) on top of the glsurfaceview.

In ExampleTransparentGlSurface.java the comment says its possible, how is this 
accomplished?  Would you give an example?

I've attempted several variations of the following:

# ExampleTransparentGlSurface.java
protected void onCreateSetContentView()
{
    setContentView(R.layout.transparent_layout);
    ((LinearLayout)findViewById(R.id.surface_holder)).addView(_glSurfaceView);
}

protected void glSurfaceViewConfig()
{
    _glSurfaceView.setEGLConfigChooser(8,8,8,8, 16, 0);
    _glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
}

public void initScene() 
{
    scene.backgroundColor().setAll(0x00000000);
}

# transparent_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent">

    <!-- Background Image -->
    <ImageView android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:src="@drawable/earth" />

    <!-- Holds Gl Surface View -->
    <LinearLayout android:layout_height="fill_parent"
        android:layout_width="fill_parent" android:id="@+id/surface_holder" />

    <!-- Widgets, etc. should be on top of 3d environment -->
    <Button android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="This is a big button" />

</FrameLayout>

Original comment by [email protected] on 23 Feb 2011 at 7:10

Attachments:

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Hi, i have the same issue with Background transparency; does anyone found a 
solution to fix this? , 
It worked for me when i used a SurfaceView in background but not over an image 
background, my code is almost the same as "[email protected]"

Original comment by [email protected] on 8 Jul 2011 at 9:13

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
it worked for me that way:
@Override 
    protected void glSurfaceViewConfig()
    {
        _glSurfaceView.setEGLConfigChooser(8,8,8,8, 16, 0);
        _glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
        _glSurfaceView.setZOrderOnTop(true);
    }

public void initScene()
    {

        scene.backgroundColor().setAll(0, 0, 0, 0);
//rest of your code
}

Original comment by [email protected] on 18 Oct 2011 at 12:35

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
it worked for me that way:
@Override 
    protected void glSurfaceViewConfig()
    {
        _glSurfaceView.setEGLConfigChooser(8,8,8,8, 16, 0);
        _glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
        _glSurfaceView.setZOrderOnTop(true);
    }

public void initScene()
    {

        scene.backgroundColor().setAll(0, 0, 0, 0);
//rest of your code
}

Original comment by [email protected] on 18 Oct 2011 at 12:48

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
hey explain to me how to do exactly? I've never used <! - Holds Gl Surface View 
-> 
<LinearLayout android: layout_height = "fill_parent" 
android: layout_width = "fill_parent" android: id = "@ + id / surface_holder" 
/> 

I just object and I want to put a button ...

Original comment by [email protected] on 11 Feb 2014 at 3:19

from min3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.