Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D4 does not display faces correctly #6

Open
tim-duncan opened this issue Apr 2, 2018 · 9 comments
Open

D4 does not display faces correctly #6

tim-duncan opened this issue Apr 2, 2018 · 9 comments

Comments

@tim-duncan
Copy link

The 4-sided dice does not display its faces properly. The number at the top of the pyramid is often different for each face - it should be the same number specified in the value property.

To reproduce...simply switch out the D6 and replace them with D4 objects in the rolling.html example. Lines 105 & 106 become:

    for (var i = 0; i < 4; i++) {
        var die = new DiceD4({size: 1.5, backColor: colors[i]});

The throw should have dice displaying one each of red=1, yellow=2, green=3 & blue=4 at the top. Instead the actual throw shows red=1 and yellow=2 as expected, but the blue and green dice have mismatched numbers:
image

@MatrixFr
Copy link

MatrixFr commented Apr 6, 2018

+1

@byWulf
Copy link
Owner

byWulf commented Apr 6, 2018

Ty for the report. I'm currently moving to a new city so time is short. I try to look into this in a few weeks. If you find the bug until I had time, feel free to submit a pull request! :)

@giorgiobeggiora
Copy link

was this fixed?

@jaxx1rr
Copy link

jaxx1rr commented Oct 30, 2018

I tried to fix it but failed misserably.. I think sometimes it works and sometimes it doesnt and thats my problem trying to modify the faces , also why is there a 0 array the other dice dont have that:
this.faceTexts = [[], ['0', '0', '0'], ['2', '4', '3'], ['1', '3', '4'], ['2', '1', '4'], ['1', '2', '3']];

@giorgiobeggiora
Copy link

any news about this?

liffiton added a commit to liffiton/threejs-dice that referenced this issue May 15, 2019
Part of shift_dice_faces() from the original dice.js had not been brought into this adaptation.  I've attempted to port it over.  It seems to work in my tests, but I am not 100% confident given I haven't fully understood the underlying code.
@liffiton
Copy link

Feel free to try the change in my pull request. It's a few lines added to shiftUpperValue(). If anyone runs into problems with it, please let me know.

@tim-duncan
Copy link
Author

I have tested the fix by Mark (@liffiton) and found that it was almost there - see my comments on his PR #8 . Removing the second restriction in the if-condition as I suggest seems to work for all cases.

The fix probably isn't in the correct location in a design sense and should be moved back into the DiceD4 class somehow - probably there should be an override-able method in the base class for updating materials for a given face value.

@byWulf
Copy link
Owner

byWulf commented May 26, 2019

Thanks for the help guys! Feel free the resolve the merge conflicts @tim-duncan and I would merge your PR :)

byWulf added a commit that referenced this issue Sep 23, 2021
Bump three to 0.131.0, Buffer Geometry,  Incorrect final face & D4 Material (Issues #6 #12 #19 )
@byWulf
Copy link
Owner

byWulf commented Sep 23, 2021

Please try it out, I just merged @eipporko 's PR. If that is enough, I would close @tim-duncan 's PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants