Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
eos
Commits
fe16396d
Commit
fe16396d
authored
Apr 22, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed writeObj
parent
145c8fdf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
examples/fit_model.cpp
examples/fit_model.cpp
+2
-2
include/eos/render/Mesh.hpp
include/eos/render/Mesh.hpp
+1
-1
src/eos/render/Mesh.cpp
src/eos/render/Mesh.cpp
+5
-5
No files found.
examples/fit_model.cpp
View file @
fe16396d
...
...
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
// Obtain the full mesh and draw it using the estimated camera:
render
::
Mesh
mesh
=
morphableModel
.
drawSample
(
fittedCoeffs
,
vector
<
float
>
());
render
::
write
O
bj
(
mesh
,
"out.obj"
);
// save the mesh as obj
render
::
write
_o
bj
(
mesh
,
"out.obj"
);
// save the mesh as obj
// Draw the projected points again, this time using the fitted model shape:
for
(
auto
&&
idx
:
vertexIndices
)
{
...
...
@@ -199,7 +199,7 @@ int main(int argc, char *argv[])
// Save the output image:
cv
::
imwrite
(
"out.png"
,
outimg
);
std
::
cout
<<
"Finished fitting and wrote result to out.png."
<<
std
::
endl
;
cout
<<
"Finished fitting and wrote result to out.png."
<<
endl
;
return
EXIT_SUCCESS
;
}
include/eos/render/Mesh.hpp
View file @
fe16396d
...
...
@@ -53,7 +53,7 @@ public:
* @param[in] mesh The mesh to save as obj.
* @param[in] filename Output filename.
*/
void
write
O
bj
(
Mesh
mesh
,
std
::
string
filename
);
void
write
_o
bj
(
Mesh
mesh
,
std
::
string
filename
);
}
/* namespace render */
}
/* namespace eos */
...
...
src/eos/render/Mesh.cpp
View file @
fe16396d
...
...
@@ -25,19 +25,19 @@
namespace
eos
{
namespace
render
{
void
write
O
bj
(
Mesh
mesh
,
std
::
string
filename
)
void
write
_o
bj
(
Mesh
mesh
,
std
::
string
filename
)
{
std
::
ofstream
objFile
(
filename
);
assert
(
mesh
.
vertices
.
size
()
==
mesh
.
colors
.
size
());
std
::
ofstream
obj_file
(
filename
);
for
(
std
::
size_t
i
=
0
;
i
<
mesh
.
vertices
.
size
();
++
i
)
{
obj
F
ile
<<
"v "
<<
mesh
.
vertices
[
i
][
0
]
<<
" "
<<
mesh
.
vertices
[
i
][
1
]
<<
" "
<<
mesh
.
vertices
[
i
][
2
]
<<
" "
<<
mesh
.
colors
[
i
][
0
]
<<
" "
<<
mesh
.
colors
[
i
][
1
]
<<
" "
<<
mesh
.
colors
[
i
][
2
]
<<
" "
<<
std
::
endl
;
obj
_f
ile
<<
"v "
<<
mesh
.
vertices
[
i
][
0
]
<<
" "
<<
mesh
.
vertices
[
i
][
1
]
<<
" "
<<
mesh
.
vertices
[
i
][
2
]
<<
" "
<<
mesh
.
colors
[
i
][
0
]
<<
" "
<<
mesh
.
colors
[
i
][
1
]
<<
" "
<<
mesh
.
colors
[
i
][
2
]
<<
" "
<<
std
::
endl
;
}
for
(
auto
&&
v
:
mesh
.
tvi
)
{
// Add one because obj starts counting triangle indices at 1
obj
F
ile
<<
"f "
<<
v
[
0
]
+
1
<<
" "
<<
v
[
1
]
+
1
<<
" "
<<
v
[
2
]
+
1
<<
std
::
endl
;
obj
_f
ile
<<
"f "
<<
v
[
0
]
+
1
<<
" "
<<
v
[
1
]
+
1
<<
" "
<<
v
[
2
]
+
1
<<
std
::
endl
;
}
return
;
...
...
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