Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 39524
In Process

askthedev.com Latest Questions

Asked: May 10, 20252025-05-10T02:13:53+05:30 2025-05-10T02:13:53+05:30

How can I limit the curl effect in my cylinder-based page simulation to preserve the spine’s appearance?

anonymous user

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!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2025-05-10T02:13:55+05:30Added an answer on May 10, 2025 at 2:13 am

      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:

      • Limit the Curl Radius: Maybe consider limiting the radius effect as you approach the spine. You could have a distance check where the curl effect fades out as the verts get closer to the spine. This could help keep that area looking natural.
      • Adjust the Angle Calculation: You might play around with the angle calculation a bit. Instead of a straight ratio, consider nonlinear adjustments that can help retain more of the spine structure.
      • Separate the Spine: If possible, treat the spine as a separate geometry that doesn’t deform with the curl. You can then apply the curl effect just to the page areas while keeping the spine’s vertices fixed.
      • Control the Deformation: Introduce a scaling factor that reduces the deformation effect as you near the center of the page. This way, you can maintain the illusion without going overboard on the curl.

      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!

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2025-05-10T02:13:56+05:30Added an answer on May 10, 2025 at 2:13 am

      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.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Sidebar

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.