I’m diving headfirst into simulating a page curl effect for my custom OpenGL rendering engine, and honestly, it’s been quite the journey. Initially, I tried following the approach from the paper “Turning pages of 3D electronic books,” using a cone to create the curl. It worked to a certain extent, but the parameters were super finicky—just a slight tweak, and the whole thing would behave unexpectedly.
So, I made the switch to a cylinder-based method, which seemed like a good idea at the time. I mapped the points of the page surface onto a cylinder, and I started to see some pretty nice curl effects. However, that’s where things got tricky. While the curl looks fantastic, I’ve run into a major issue: preserving the spine of the book during the simulation. Every time I adjust the axis and radius parameters for the cylinder, the deformation seems to ruin the illusion, making the spine look awkward and unrealistic.
To give you an idea of what I’m working with, I’m using a Right-Handed coordinate system where the axis of the cylinder and the page lie on the XZ plane. The algorithm I’ve implemented is pretty straightforward in pseudocode, but even though it runs fine on both CPU and GPU, making the curl look physically limited is the real struggle.
Here’s a snippet of the algorithm I’m using:
“`plaintext
let radius be the radius of the cylinder.
let axis be the axis of the cylinder.
for each vertex V of the mesh:
let P be the projection of V on the axis,
let D be the distance from V to P,
let theta be D / radius
let dir be the direction of the PV vector
let delta be dir * cos(theta) * radius
update V to (V.x + delta.x, sin(theta * radius))
Render the mesh.
“`
I’m hoping someone has dealt with a similar challenge or has insights into limiting the curl effect without compromising the actual look of the spine. Any suggestions on parameter adjustments or additional constraints would be immensely helpful!
Page Curl Simulation Struggles
Sounds like you’re deep into some pretty tricky stuff! The page curl effect can really be a pain to get just right, especially when it comes to the spine looking good.
From what you’ve described, it seems like you’ve made some solid progress already with that cylinder approach. The spine issue really is the kicker though. Have you tried a couple of tweaks? Here are a few suggestions:
It sounds like you’re almost there! Just little adjustments can sometimes make a huge difference. Keep experimenting, and don’t hesitate to share any cool visual results you get!
Your current cylinder-based approach, while visually appealing, struggles primarily due to a lack of constraints that limit the curl near the book spine. To resolve the distortion around the spine, you could introduce an additional constraint or weight factor based on the vertex’s proximity to the binding area. Specifically, consider computing a blend factor (e.g., a smoothstep function) across the width of the page, ensuring that vertices closest to the spine have minimal deformation while vertices toward the outer edge experience maximum curl. Another option is to explicitly clamp the cylinder radius based on vertex position so that the curl radius grows steadily from the spine outward, preventing unrealistic deformation near the bound section.
Additionally, refining your vertex transformation logic can have a significant impact: rather than uniformly calculating theta and displacement for all vertices, you could define a threshold or boundary region where no deformation occurs—essentially suspending the curl within an inner margin. A modified vertex shader could smoothly interpolate vertex displacement starting from zero at the spine outward to full curl, ensuring a physically plausible transition. Employing a distance-driven and spine-aware weighting scheme in your shader or CPU-side preprocessing can offer a precise, controllable curl effect that maintains the page’s structural integrity and preserves realism along your book’s spine.