-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ripple effect does not work with live wallpaper #659
Comments
not have this option in Walpaper class: mRenderer.setSurfaceView (mSurfaceView); |
I'm not sure what this means. Can you please explain more? |
I'm sorry but I'm having a hard time understanding what your question is. Please read the guidelines for submitting issues. |
I will explain better to inherit the class Wallpaper blilioteca Rajawali, I can not run the animation the same way as in the activity, understand? in the activity RajawaliRipplesActivity, have methods: mSurfaceView.setOnTouchListener (this); |
my language is portuguese |
ripple not work in livewallpaper? |
I mean, the class inheriting wallpaper native library? |
It can work. The constructor for |
yes i see, I'm running it now and follow it to build my own, but I can not call the methods as: mSurfaceView.setOnTouchListener (this); |
render the image, but I can not simulate screen taps |
Are you receiving touch events? Have you registered to receive them? Are you certain you are handling them correctly? |
I did the same as in normal activity, the renderer is the same, only modified the activity, which is now a service for wallpaper |
So what view are you registered to receive touch events for? |
My Service: public class ServiceWallpaper extends Wallpaper implements OnTouchListener {
private RajawaliRipplesRenderer mRenderer;
private Point mScreenSize;
@Override
public Engine onCreateEngine() {
mRenderer = new RajawaliRipplesRenderer(this);
return new WallpaperEngine(this.getSharedPreferences(SHARED_PREFS_NAME,
Context.MODE_PRIVATE), getBaseContext(), mRenderer, false);
}
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
Log.i("toqueX", event.getX() + "Y = " + event.getY());
mRenderer.setTouch(event.getX() / mScreenSize.x,
1.f - (event.getY() / mScreenSize.y));
return true;
}
if (event.getAction() == MotionEvent.ACTION_MOVE) {
Log.i("toqueX", event.getX() + "Y = " + event.getY());
mRenderer.setTouch(event.getX(), event.getY());
}
int action = MotionEventCompat.getActionMasked(event);
return true;
// return super.onTouchEvent(event);
}
} |
My Renderer: public class RipplesRenderer extends RajawaliRenderer {
private final int NUM_CUBES_H = 2;
private final int NUM_CUBES_V = 2;
private final int NUM_CUBES = NUM_CUBES_H * NUM_CUBES_V;
private Animation3D[] mAnims;
private TouchRippleFilter mFilter;
private long frameCount;
private final int QUAD_SEGMENTS = 10;
public RipplesRenderer(Context context) {
super(context);
// MUDEI AKI PADRao e 60
setFrameRate(10);
}
protected void initScene() {
mAnims = new Animation3D[NUM_CUBES];
mCamera.setPosition(0, 0, 5);
DirectionalLight light = new DirectionalLight(0, 0, 1);
light.setPower(1f);
BaseObject3D group = new BaseObject3D();
DiffuseMaterial material = new DiffuseMaterial();
material.setUseColor(true);
Random rnd = new Random();
for (int y = 0; y < NUM_CUBES_V; ++y) {
for (int x = 0; x < NUM_CUBES_H; ++x) {
Cube cube = new Cube(.7f);
cube.setPosition(x * 2, y * 2, 50);
cube.addLight(light);
cube.setMaterial(material);
cube.setColor((int) (0xffffff * rnd.nextFloat()));
group.addChild(cube);
Number3D axis = new Number3D(rnd.nextFloat(), rnd.nextFloat(),
rnd.nextFloat());
// mudei aki padrao 360
Animation3D anim = new RotateAnimation3D(axis, 360, 360);
anim.setRepeatMode(RepeatMode.RESTART);
// mudei aki padrao 8000
anim.setDuration(800);
anim.setTransformable3D(cube);
int index = x + (NUM_CUBES_H * y);
mAnims[index] = anim;
}
}
group.setX(((NUM_CUBES_H - 1) * 8) * -.1f);
group.setY(((NUM_CUBES_V - 1) * 8) * -.1f);
group.setZ(-1f);
addChild(group);
SimpleMaterial planeMat = new SimpleMaterial();
// mudei aki padrao era streech
Bitmap texture = BitmapFactory.decodeResource(mContext.getResources(),
R.drawable.fundo);
planeMat.addTexture(mTextureManager.addTexture(texture));
Plane plane = new Plane(3, 1, 4, 4);
plane.setRotZ(-90);
plane.setScale(3.7f);
plane.setMaterial(planeMat);
addChild(plane);
mFilter = new TouchRippleFilter();
// mudei padrao 62
mFilter.setRippleSize(50);
mFilter.setRippleSpeed(5);
mFilter.setTime(0);
mFilter.setDuration(1);
mPostProcessingRenderer.setQuadSegments(QUAD_SEGMENTS);
mPostProcessingRenderer.setQuality(PostProcessingQuality.HIGH);
addPostProcessingFilter(mFilter);
}
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
//((RajawaliExampleActivity) mContext).showLoader();
super.onSurfaceCreated(gl, config);
for (int i = 0; i < NUM_CUBES; ++i) {
registerAnimation(mAnims[i]);
mAnims[i].play();
}
mFilter.setScreenSize(mViewportWidth, mViewportHeight);
// ((RajawaliExampleActivity) mContext).hideLoader();
}
public void onDrawFrame(GL10 glUnused) {
super.onDrawFrame(glUnused);
mFilter.setTime((float) frameCount++ * .05f);
}
public void onSurfaceChanged(GL10 gl, int width, int height) {
gl.glAlphaFunc(10, 10);
gl.glBlendFunc(100, 100);
super.onSurfaceChanged(gl, width, height);
mFilter.setScreenSize(width, height);
}
public void setTouch(float x, float y) {
mAnims = new Animation3D[NUM_CUBES];
mFilter.addTouch(x, y, frameCount * .05f);
}
} |
mRenderer = RipplesRenderer(); |
Yeah, you aren't registered to receive a touch event, thats why you aren't receiving touch events. Also, please read the GitHub markdown tutorial to see how to format your code samples. HTML tagging doesn't work. |
but, this mSurfaceView.setOnTouchListener(this); is not available, it is only available for activities |
You need to inherit the WallpaperEngine class and override the onTouchEvent. |
and Class Rajawali Wallpaper not implement wallpaperEngine? |
|
you post link for format code in github??? |
My solution was not permanent, is faulty, but is running, sometimes hangs while giving many screen taps. public class ServiceWallpaper extends Wallpaper {
} |
So it seems like the issue is resolved. Hanging from too many taps is to be expected...devices can only process data so fast. |
rajawali does not work with samsung galaxy tab 2??? wallpaper error: Called unimplemented OpenGL ES API? |
can you paste the complete stack trace here???????????????????? |
05-03 16:07:22.997: E/libEGL(14432): called unimplemented OpenGL ES API |
@winigma Você poderia por favor ser mais descritivo quando você faz perguntas? Ele vai tornar as coisas muito mais fácil. Obrigado. |
was only that, and not performed, no other Feedback |
now this: |
Have you installed the RajawaliExamples app? Does it run without problems? Or does it crash as well? |
there in Rajawali Examples |
in my wallpaper this: |
Do you mean that RajawaliExamples crashes as well? Or does it run fine? |
but in galaxy s3 gran duos and works perfectly |
Do you mean that RajawaliExamples crashes as well? Or does it run fine? In ripple effeect not |
But do the other examples run fine? Or do they all crash? |
you test in tablets? |
Yes. We have quite a few devices that it is tested on to fully encompass the range of possibilities. |
Mas os outros exemplos correr bem? Ou todos eles acidente? |
only in 2000 textures and the ripple effect, others are fine |
Qual é a última mensagem de commit para Rajawali e Rajawali exemplos que você tem? |
last version... |
Are you certain? It has been under heavy development with near daily changes over the last week. |
my version is 3 days ago |
I submitted 21422d8 yesterday which fixed the 2000 planes example. |
you need to update your repository |
and rippples effects? |
Did you try it after updating it? |
Please read the cloning instructions. In your case I recommend using the tags as master is under HEAVY development and should not be considered bug free. That said, unless your support request involves the code in the TAG or is notifying us of a bug, we are not going to put much effort into it since the development is fluid. In the case of post processing effects, they are being removed in favor of something else on the master branch so we will no be supporting them. |
but you know know if some devices have openGL version mismatch eat the Rajawali? |
I followed these steps, as I said, the galaxy s3 works, but the galaxy tab does not work. |
If a device claims OpenGL 2.0 support, Rajawali supports it. Device specific bugs are to be expected though as you are dealing with a very low level interface. We do our best to eliminate them but particularly with Samsung devices, it is a constant battle we can never win so some acceptance of this situation must be present. You should not look at 3D graphics as being a one solution fits all problem. |
ok, undesteand, I thought it might be my problem to implement the code |
I apologize for any difficulty we have with the language barrier, we are doing our best. For future questions, following the GitHub markdown for code and stack traces and providing complete stack traces and error messages, as well as more complete code, or at least context for the code will help us understand the problem much more. |
I saw a doubt like what I have, but did not see the solution ...
I'm creating my live wallpaper based on the template. but the effect does not work in normal activity was as follows:
and livewallpaoer have this:
The text was updated successfully, but these errors were encountered: