Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Glow
glow-extras
Commits
2c3cb630
Commit
2c3cb630
authored
Dec 10, 2020
by
Philip Trettner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed normal of integer objects
parent
5038e435
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
viewer/glow-extras/viewer/canvas.hh
viewer/glow-extras/viewer/canvas.hh
+3
-3
No files found.
viewer/glow-extras/viewer/canvas.hh
View file @
2c3cb630
...
...
@@ -501,14 +501,14 @@ public:
triangle_ref
add_face
(
tg
::
triangle
<
D
,
T
>
const
&
t
,
material
const
&
mat
=
{})
{
static_assert
(
D
==
3
,
"only supports 3D currently"
);
auto
n
=
tg
::
vec3
(
tg
::
normal_of
(
t
));
auto
n
=
tg
::
normal_of
(
tg
::
triangle3
(
t
));
return
_add_triangle
(
tg
::
pos3
(
t
.
pos0
),
tg
::
pos3
(
t
.
pos1
),
tg
::
pos3
(
t
.
pos2
),
n
,
n
,
n
,
mat
);
}
template
<
class
T
>
triangle_ref
add_face
(
tg
::
box
<
2
,
T
,
3
>
const
&
t
,
material
const
&
mat
=
{})
{
auto
start_cnt
=
_triangles
.
size
();
auto
n
=
tg
::
vec3
(
tg
::
normal_of
(
t
));
auto
n
=
tg
::
normal_of
(
tg
::
box2in3
(
t
));
auto
v00
=
tg
::
pos3
(
t
[{
-
1
,
-
1
}]);
auto
v01
=
tg
::
pos3
(
t
[{
-
1
,
+
1
}]);
auto
v10
=
tg
::
pos3
(
t
[{
+
1
,
-
1
}]);
...
...
@@ -522,7 +522,7 @@ public:
{
auto
start_cnt
=
_triangles
.
size
();
static_assert
(
D
==
3
,
"only supports 3D currently"
);
auto
vc
=
tg
::
pos3
(
tg
::
centroid_of
(
t
));
auto
vc
=
tg
::
centroid_of
(
tg
::
quad3
(
t
));
auto
v00
=
tg
::
pos3
(
t
.
pos00
);
auto
v01
=
tg
::
pos3
(
t
.
pos01
);
auto
v10
=
tg
::
pos3
(
t
.
pos10
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment