Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Courses
Scotty3D
Commits
2f64ad2c
Commit
2f64ad2c
authored
Sep 30, 2020
by
TheNumbat
Browse files
change halfedge placement
parent
c2535f0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
2f64ad2c
cmake_minimum_required
(
VERSION
3.17
)
cmake_minimum_required
(
VERSION
2.8
)
# define project
# define project
...
...
src/gui/model.cpp
View file @
2f64ad2c
...
@@ -283,11 +283,11 @@ void Model::halfedge_viz(Halfedge_Mesh::HalfedgeRef h, Mat4 &transform) {
...
@@ -283,11 +283,11 @@ void Model::halfedge_viz(Halfedge_Mesh::HalfedgeRef h, Mat4 &transform) {
float
v0s
=
vert_sizes
[
v_0
->
id
()],
v1s
=
vert_sizes
[
v_1
->
id
()];
float
v0s
=
vert_sizes
[
v_0
->
id
()],
v1s
=
vert_sizes
[
v_1
->
id
()];
float
s
=
0.3
f
*
(
v0s
<
v1s
?
v0s
:
v1s
);
float
s
=
0.3
f
*
(
v0s
<
v1s
?
v0s
:
v1s
);
// Move to center of edge and
towards center of fac
e
// Move to center of edge and
away from edg
e
Vec3
offset
=
(
v1
-
v0
)
*
0.2
f
;
Vec3
offset
=
(
v1
-
v0
)
*
0.2
f
;
Vec3
face
=
h
->
face
()
->
center
();
Vec3
face
_n
=
h
->
face
()
->
normal
();
Vec3
avg
=
0.5
f
*
(
v0
+
v1
);
Vec3
avg
=
0.5
f
*
(
v0
+
v1
);
offset
+=
(
face
-
avg
).
unit
()
*
s
*
0.2
f
;
offset
+=
cross
(
face_n
,
dir
).
unit
()
*
s
*
0.2
f
+
face_n
*
s
*
0.05
f
;
// Align edge
// Align edge
if
(
dir
.
y
==
1.0
f
||
dir
.
y
==
-
1.0
f
)
{
if
(
dir
.
y
==
1.0
f
||
dir
.
y
==
-
1.0
f
)
{
...
...
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