Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- Transparent Textures
- Play Audio
- updatescence() is too fast compared to my phone's hardware capability
- load only 3ds file
- Error on load obj file HOT 1
- MD2 anim loop interpolation error
- Cannot Add 3d model to Android Camera View
- rotate the camera in own axis
- Multiple 3D Views in One 2D Android GUI ?
- Patch for /trunk/sampleProjects/min3dSampleProject1/src/min3d/sampleProject1/ExampleKeyframeAnimation.java
- how to Set BOTH, android:onClick AND OnTouchListener on object
- Min3D Maximum mapping
- Move project to Github
- big 3d file(3ds)
- Nexus 7 3ds imported files shows full black HOT 2
- install fail for min3dSampleProject1_020.apk
- Rectangle are not fully transparent HOT 2
- Use onTouchEvent HOT 3
- Lights in min3D
- 1 million of vertex in min3D
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from min3d.