Jump to content
Netvudu

Rigging a book

Recommended Posts

Hi there,

I´m researching a bit on how could I rig a book.

I found some interesting articles, such as this one.

Most of them use bones, or joints or sonmething similar for the pages turn.

I think, there should be a way to get an edge on this workflow using Houdini. I´m thinking on animating curves and THEN extruding them to create pages, for instance. This kind of tricks that are unique to us.

From the above tutorial I see that a deforming geometry could be used effectively for the thick of static pages. I´m still wondering the best ways to deal with a lot of flipping pages.

Any ideas, I might be overlooking so far?

Share this post


Link to post
Share on other sites

whoa! I didn´t know about this hda! I just started looking at it, but it´s terrific!

Thanks zarti. This will certainly help a lot. :)

Share this post


Link to post
Share on other sites

yes , thats awesome .

afair when i inspected that , it was more or less what you ' pre-thinked ' in the first post .

glad i could help .. ( * by simply posting the link ) =)

.cheers

--

edit:: * added a tiny clarification to avoid any miss_understanding ..

Edited by zarti

Share this post


Link to post
Share on other sites

Yep, looks like I was on the right track with the animated curves being extruded, but this Alexander Antoshuk guy has gone a lot further. :blink: He´s smart!

I love the shaping of the thickness as well as the pages interval parameter.

There´s a lot to be learnt from this asset.

Edited by Netvudu

Share this post


Link to post
Share on other sites

You can also wrap pages by offsetting rotations a little for every page.

// PARAMETERS
float start = chf('start');
float touch = chf('touch');
float speed = chf('speed');
float flip  = 1 - chf('flip');
vector fade = relbbox(0, @P);

// POSITION
@P.y -= vector( getbbox_size(0) ).y * 0.5;

// WRAP PAGES
matrix m = ident();
float copy = ( ch("../copy1/ncy") - prim(0, "copynum", @primnum) ) * flip;
float t = @Time * speed - start - copy + sin( fade.x ) + fade.z * touch;
rotate(m, smooth(0, $PI, t) * $PI, {0, 0, 1});
@P *= m;

// TEXTURE COORDINATES
v@uv = set(fade.x, fade.z * -1, 0);

pages_screen.jpg.15acb9972c771e1e3e917f9b1c1baf3c.jpg

book_flip_pages.hipnc

Edited by konstantin magnus
  • Like 4
  • Thanks 1
  • Haha 1

Share this post


Link to post
Share on other sites

Thank you!

btw. I did not know that its possible to use a link in the texture parm :lol:

Share this post


Link to post
Share on other sites

I was interested to see the different methods.. Too bad the two first link are dead :/ 
Anyone can help in this?

Share this post


Link to post
Share on other sites
On 2017. 11. 21. at 7:02 PM, konstantin magnus said:

You can also wrap pages by offsetting rotations a little for every page.


// PARAMETERS
float start = chf('start');
float touch = chf('touch');
float speed = chf('speed');
float flip  = 1 - chf('flip');
vector fade = relbbox(0, @P);

// POSITION
@P.y -= vector( getbbox_size(0) ).y * 0.5;

// WRAP PAGES
matrix m = ident();
float copy = ( ch("../copy1/ncy") - prim(0, "copynum", @primnum) ) * flip;
float t = @Time * speed - start - copy + sin( fade.x ) + fade.z * touch;
rotate(m, smooth(0, $PI, t) * $PI, {0, 0, 1});
@P *= m;

// TEXTURE COORDINATES
v@uv = set(fade.x, fade.z * -1, 0);

pages_screen.jpg.15acb9972c771e1e3e917f9b1c1baf3c.jpg

book_flip_pages.hipnc

Hello. Thank you so much for sharing. I have one question. How can I adjust both left and right? I don't want to use animation, I just want to create a feeling of fluttering left and right (?). Please advise. thank you.

Share this post


Link to post
Share on other sites
1 hour ago, eunchae said:

How can I adjust both left and right? I don't want to use animation, I just want to create a feeling of fluttering left and right

Hi hongjo,

you can spread the pages more by lowering the "flip" parameter. Other than that, this particular setup does not enable turning pages individually depending on whether they are left or right.

Share this post


Link to post
Share on other sites
1 hour ago, konstantin magnus said:

Hi hongjo,

you can spread the pages more by lowering the "flip" parameter. Other than that, this particular setup does not enable turning pages individually depending on whether they are left or right.

Thank you for answer. How do I make it go left to right instead of right to left? thank you.

Share this post


Link to post
Share on other sites
from math import sin
from math import cos
from math import pi

def book_line(geo,numvtx=6,thicknes=0.0,time = hou.time()):
    curve = geo.createNURBSCurve(numvtx,0)
    for i,vertex in enumerate(curve.vertices()):
        angle = i*(0.5 *pi)/numvtx
        pos = (min(angle,sin(angle)+time),thicknes-min(0,cos(angle)+time-1),0)
        vertex.point().setPosition(pos)
    return curve
    
geo = hou.pwd().geometry()
for i in range(200):
    time= hou.hmath.clamp(hou.time()-0.1*i,0,1)
    time = time *time
    book_line(geo,8,0.001*i,time)

 

Share this post


Link to post
Share on other sites
8 hours ago, eunchae said:

How do I make it go left to right instead of right to left?

If you dont want to change the code, you could simply append a mirror SOP and disable "keep original".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×