Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
polymesh
Commits
354b6b55
Commit
354b6b55
authored
Jul 06, 2018
by
Philip Trettner
Browse files
added quick obj reader
parent
d49eda5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/polymesh/formats/obj.cc
View file @
354b6b55
...
...
@@ -301,3 +301,9 @@ void obj_reader::parse(std::istream &in, Mesh &mesh)
}
}
}
void
polymesh
::
read_obj
(
const
std
::
string
&
filename
,
Mesh
&
mesh
,
vertex_attribute
<
glm
::
vec3
>
&
position
)
{
obj_reader
reader
(
filename
,
mesh
);
position
=
reader
.
positions_vec3
();
}
src/polymesh/formats/obj.hh
View file @
354b6b55
...
...
@@ -14,6 +14,7 @@ void write_obj(std::string const& filename,
vertex_attribute
<
glm
::
vec3
>
const
&
position
,
vertex_attribute
<
glm
::
vec2
>
const
*
tex_coord
=
nullptr
,
vertex_attribute
<
glm
::
vec3
>
const
*
normal
=
nullptr
);
void
read_obj
(
std
::
string
const
&
filename
,
Mesh
&
mesh
,
vertex_attribute
<
glm
::
vec3
>&
position
);
struct
obj_writer
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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