Skip to content
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

How do I show 2 pages in 2 page mode instead of translucent left page? #11

Open
sOt0nGx opened this issue Aug 3, 2011 · 13 comments
Open

Comments

@sOt0nGx
Copy link

sOt0nGx commented Aug 3, 2011

How do I show 2 pages in 2 page mode instead of translucent left page?

As per the title.

It is great in 1 page mode but in 2 page, if I want to show 2 pages at a time e.g. 1&2, flip a page to 3&4... how do I do that?

@Base2526
Copy link

Base2526 commented Aug 3, 2011

Pls, help

i want example source code show 2 pages in 2 page mode

or you how much will it cost. Actually need it.

thx,
Email : ccp_ccp_1@hotmail.com

@harism
Copy link
Owner

harism commented Aug 3, 2011

Hiya,

I can't give you exact instructions but in gereral you should introduce 2
textures per page. And instead of rendering translucent background you ought
to use this backsiding texture.

Hope this helps.

H
On Aug 3, 2011 7:50 AM, "sOt0nGx" <
reply@reply.github.com>
wrote:

How do I show 2 pages in 2 page mode instead of translucent left page?

As per the title.

It is great in 1 page mode but in 2 page, if I want to show 2 pages at a
time e.g. 1&2, flip a page to 3&4... how do I do that?

Reply to this email directly or view it on GitHub:
#11

@Base2526
Copy link

Base2526 commented Aug 4, 2011

thx,
if i want rendering translucent background between ACTION_MOVE [PAGE Mesh] , I have to do it.

Android Programmer.

@sOt0nGx
Copy link
Author

sOt0nGx commented Aug 4, 2011

I managed to make the right side show only even numbered pages in landscape but
which class/function attaches the image to the left page?

Thanks

@sOt0nGx sOt0nGx closed this as completed Aug 4, 2011
@sOt0nGx sOt0nGx reopened this Aug 4, 2011
@Neo1975
Copy link

Neo1975 commented Aug 27, 2011

I'm interested into this issue, I'm also would like to work about it but I doesn't have experience about OpenGL so I doesn't know where to start, I will to search some text about OpenGL but I'm not sure is possible to apply 2 texture: frontside and backside to a single mesh.

@csname
Copy link

csname commented Feb 8, 2012

I'm also interested.

@harism: It would be great if you could provide some code for this.

Thank you!!

@mguerra88
Copy link

Hi everyone,

First of all thanks for this great API harism ;) I'm also implementing a "book like effect" and I need to show pages side by side instead of the transculent backpage. So far I managed to draw the back side texture. However, it doesn't draw quite right... Only one quarter of the image is rendered as you can see in the snapshot below:

http://imageshack.us/photo/my-images/594/device20120410175255.png/

My OpenGL knowledge is limited and I have no clue what am I doing wrong... I use the following code to draw the backside texture (on draw() method from CurlMesh class):

        if (DRAW_TEXTURE && mBitmapBack != null) 
    {
        gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureIds[1]);
        GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, mBitmapBack, 0);
        mBitmapBack = null;
    }

    if (DRAW_TEXTURE)
    {
        gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureIds[1]);
    }

    int backStartIdx = Math.max(0, mVerticesCountFront - 2);
    int backCount = mVerticesCountFront + mVerticesCountBack - backStartIdx;

        // Draw blank / 'white' front facing vertices.
    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, backStartIdx, backCount);
    // Draw back facing texture.
    if (DRAW_TEXTURE) 
    {
        gl.glEnable(GL10.GL_BLEND);
        gl.glEnable(GL10.GL_TEXTURE_2D);
        gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, backStartIdx, backCount);
        gl.glDisable(GL10.GL_TEXTURE_2D);
        gl.glDisable(GL10.GL_BLEND);
    } 

If anyone can tell me what am I doing wrong I would appreciate it... This the only thing missing in my project :(

Regards,
Mark

@cags12
Copy link
Contributor

cags12 commented Apr 30, 2012

hey guys, I managed to resolve this issue, 2 pages landscape and 1 page portraid, I'm new to git so when I figured out how to create a fork and make a pull request I'll share it to you. BTW harism, great job!

a little preview here
http://www.youtube.com/watch?v=iwu7P5PCpsw

@cags12
Copy link
Contributor

cags12 commented Apr 30, 2012

Done, pull request in course, check my profile in case it´s not accepted.

@harism
Copy link
Owner

harism commented May 5, 2012

Sorry it took me so long time but I did a "automated pull" just seconds ago. I didn't take a proper look on this patch though but I'm hoping it works as expected. I've got some ideas how to do whole Bitmap querying totally differently but it'll take a while before getting there.

Thanks, Christian.

@cags12
Copy link
Contributor

cags12 commented May 5, 2012

Hi, so far I´ve tested, it works as expected. The only concern I have and maybe you can help me is described at CurlMesh Class Line 818 at SwapSheet method. I would like to optimize it. Check it out when you have some time. I´m going to be working in some other functionality I´d like to add

Regards

@cags12
Copy link
Contributor

cags12 commented May 7, 2012

Harism, Hi, I saw the changes you made to the code. Testing it on my phone and the emulator, it doesn´t show the 2 pages as expected. It show always a back gray facing no matter is in landscape or portraid. see the picture

http://img821.imageshack.us/img821/4204/photoneva.jpg

EDIT: Forgeit. I see the Note you made about the BitmapProvider, It works now. Thanks for the code update.

@bindumadhaviboya
Copy link

I want to add graphs to the bookview. I have integrated your code but unable to add charts. Please help me, how can I add Charts to the PageProvider Class

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants