Jump to content

[Solved] Calculating offsets


Fenolis

Recommended Posts

In Anastasia Opara's talk at SIGGRAPH 2017, she mentions a procedure for generating a line of books leaning on one another (28:26).

I have managed to replicate most of the steps (her explanations are excellent), except for the last step, in which Ana describes calculating the offset for a case in which the height of the current book is shorter than the distance from the top right corner of the previous book to the point used to instance the current book, at about 29:10 in the video.

As proof of my attempt, here is my current progress:

layingbooks.thumb.PNG.7f6ae261a362a5f50a579d9d82163036.PNG

I am encountering the exact problem she describes, where the books appear to be floating due to the height differences.

Her solution, in essence, was to take the top left corner of the book and measure its distance from the previous book's bottom right corner (or right bounds, this was not explained as clearly), but it seems to me that would only work for the first/second books, since the bottom right corner of the first book shares the same x-value as its xmax bound.

I could not achieve the same result as demonstrated in the video.

layingbooks2.thumb.PNG.a44066a44cc8d1d8f7b6b2c803a8910f.PNG

Failing to replicate the offset calculations, I then tried calculating a ray from the top left corner of the current book towards the previous iteration. This seemed to work until I ran through the random seed value and discovered that this method was not effective either.

Would anyone have any idea of how to calculate this offset amount, or an explanation of how Ana's method works?

 

Link to comment
Share on other sites

  • Fenolis changed the title to [Solved] Calculating offsets
4 hours ago, konstantin magnus said:

Why dont you publish your solution? :P

Why not, indeed?

leaningBooks.hipnc

I apologize in advance if any of the code appears sloppy, I might have done some things in a more roundabout way than was required...

Of course, credit for the procedure should go to Anastasia Opara, I merely reverse engineered it following her presentation!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...