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
ee1c359a
Commit
ee1c359a
authored
Sep 24, 2016
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write_obj will now always write out texcoords if they're available
Also removed trailing space from vertex/colour data
parent
bd72c78d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
include/eos/render/Mesh.hpp
include/eos/render/Mesh.hpp
+10
-2
No files found.
include/eos/render/Mesh.hpp
View file @
ee1c359a
...
...
@@ -68,12 +68,20 @@ inline void write_obj(Mesh mesh, std::string filename)
if
(
mesh
.
colors
.
empty
())
{
for
(
std
::
size_t
i
=
0
;
i
<
mesh
.
vertices
.
size
();
++
i
)
{
obj_file
<<
"v "
<<
mesh
.
vertices
[
i
][
0
]
<<
" "
<<
mesh
.
vertices
[
i
][
1
]
<<
" "
<<
mesh
.
vertices
[
i
][
2
]
<<
" "
<<
std
::
endl
;
obj_file
<<
"v "
<<
mesh
.
vertices
[
i
][
0
]
<<
" "
<<
mesh
.
vertices
[
i
][
1
]
<<
" "
<<
mesh
.
vertices
[
i
][
2
]
<<
std
::
endl
;
}
}
else
{
for
(
std
::
size_t
i
=
0
;
i
<
mesh
.
vertices
.
size
();
++
i
)
{
obj_file
<<
"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_file
<<
"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
;
}
}
if
(
!
mesh
.
texcoords
.
empty
())
{
for
(
auto
&&
tc
:
mesh
.
texcoords
)
{
obj_file
<<
"vt "
<<
tc
[
0
]
<<
" "
<<
tc
[
1
]
<<
std
::
endl
;
}
}
...
...
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