-
Notifications
You must be signed in to change notification settings - Fork 137
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
Added option to not show back face of text #38
base: master
Are you sure you want to change the base?
Conversation
Added an optional option to textcomponents, option.backface {bool}. The extrusion of the text is set to 0 if user don't want back facing text
@@ -400,24 +401,28 @@ function meshesForText(text, font, options) { | |||
transform.update(); | |||
meshBuilder.addMeshData(meshData, transform); | |||
} | |||
|
|||
if (options.backface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add { }
frontFace(); | ||
else // If the back face shouldn't be visible, set extrusion to 0s | ||
if (options.backface) { | ||
frontFace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt it be the backface() that is drawn if options.backface is true?
Also, could you make the default behavior be to draw backface if nothing is specified (to behave like before), by doing options.backface = options.backface !== undefined ? options.backface || true; at the top?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @rherlitz. Thank you for the review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, added the options.backface at the top, but when i change that the backface() is to be drawn when option.backface is true, I get the text backwards. The text isn't visible on the other side of the material due to the other face not being drawn.
Updated the functions to draw correct face of glyph mesh
The bug was because of the extrusion, fixed now! Should be good to go 👍 |
Added an optional option to textcomponents, option.backface {bool}.
The extrusion of the text is set to 0 if user don't want back facing text