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

Added option to not show back face of text #38

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/goo/geometrypack/text/TextMeshGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ function meshesForText(text, font, options) {
meshBuilder.addMeshData(meshData, transform);
}

if (options.backface)
frontFace();
else // If the back face shouldn't be visible, set extrusion to 0s
if (options.backface) {
frontFace();
Copy link
Contributor

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?

Copy link

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!

Copy link
Author

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.

With frontface drawn, no backface:
skarmavbild 2016-07-13 kl 10 26 32

With backface drawn, no frontface:
skarmavbild 2016-07-13 kl 10 25 50

} else { // If the back face shouldn't be visible, set extrusion to 0s
options.extrusion = 0;

}
backFace();

if (options.extrusion) {
Expand Down