Hi!
I’m following the tutorial as presented here. And I’m trying to understand this one specific section, which is changing the material via next/previous arrows. I do understand most of what is going on, but when I try to work through the math, it doesn’t make sense to me (and I know I’m probably doing something incorrectly).
In the screenshot you’ll see the puzzle configuration. So here is what I’m trying to work through. To start, the “CouchMaterialChange” variable is set to 500 (which is divisible by the total number of items in the “CouchMaterials” list (which is 5). I won’t explain all the code here (it’s in the screenshot), but here is how my math is working out.
– CouchMaterialChange(500)
– User clicks “next”
– This adds 1 to CouchMaterialChange, thus 501
– 501 is divided by the number of materials in the list (5), thus 100.2
– The remainder is then returned, 2.
– Hence 2 points to the 2nd item in the CouchMaterials list.
Am I thinking of this correctly, or where have I messed up the logic?
Any help would be appreciated!
Check out my sketch book :) | www.instagram.com/b.potts.art/