Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
36bf0a8f
Commit
36bf0a8f
authored
Mar 26, 2013
by
Janis Born
Browse files
fix wrong indices in OBJ normal computation
parent
7e526c3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ACGL/OpenGL/Data/GeometryDataLoadStoreOBJ.cc
View file @
36bf0a8f
...
...
@@ -306,9 +306,9 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
if
(
_computeNormals
)
{
size_t
triangleIndex
=
i
/
3
;
glm
::
vec3
v0
=
(
glm
::
vec3
)
positionData
[
indices
[
triangleIndex
+
0
].
position
];
glm
::
vec3
v1
=
(
glm
::
vec3
)
positionData
[
indices
[
triangleIndex
+
1
].
position
];
glm
::
vec3
v2
=
(
glm
::
vec3
)
positionData
[
indices
[
triangleIndex
+
2
].
position
];
glm
::
vec3
v0
=
(
glm
::
vec3
)
positionData
[
indices
[
3
*
triangleIndex
+
0
].
position
];
glm
::
vec3
v1
=
(
glm
::
vec3
)
positionData
[
indices
[
3
*
triangleIndex
+
1
].
position
];
glm
::
vec3
v2
=
(
glm
::
vec3
)
positionData
[
indices
[
3
*
triangleIndex
+
2
].
position
];
glm
::
vec3
normal
=
glm
::
normalize
(
glm
::
cross
(
v1
-
v0
,
v2
-
v0
));
abData
[
pos
++
]
=
normal
.
x
;
abData
[
pos
++
]
=
normal
.
y
;
...
...
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