Discuss Scratch

Tycho112
Scratcher
500+ posts

How do you make a 3d dice in scratch?

here is the link: https://scratch.mit.edu/projects/412371695
The dice will work, but the dots will not
RokCoder
Scratcher
1000+ posts

How do you make a 3d dice in scratch?

The dots are working just as well as the sides in that they're all displaying all of the time. If you modify your code so that each face of the dice is displayed in a different colour it'll quickly become clear that the sides that are hidden from view are still being displayed. In fact, I would do that anyway to make the cube look better (or, at least, it will look better once the hidden surfaces have been removed).

You're best approach in this particular project would be to use a cross-product to determine which sides should be back face culled. Once you've done that you only need to draw the sides of the dice that are facing you (and the dots that are on those sides).
RobFarley74
Scratcher
100+ posts

How do you make a 3d dice in scratch?

It's impressive that you've done this, I'm slightly confused how you don't understand the issue, unless you've used someone else's script (and if that's the case you've not credited them).

As previously mentioned you're not doing hidden face removal, or indeed just correct z sorting so the things furthest away draw first. If you just do Z sorting you'll solve the issue, hidden face removal will optimise the render time.

That said… Just as an aside, you've got the dots wrong, the total of opposite sides should add up to 7, so a 1 has a 6 on the opposite side, 5 and 2 and 3 and 4.

Powered by DjangoBB