Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Superimpose Mesh Lib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Andrea Ruzzenenti
Superimpose Mesh Lib
Commits
7d1cc0c5
Commit
7d1cc0c5
authored
Jun 21, 2020
by
andrea ruzzenenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
model scale addded + vertex normal bugix
parent
da269af9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
src/SuperimposeMesh/include/SuperimposeMesh/SICAD.h
src/SuperimposeMesh/include/SuperimposeMesh/SICAD.h
+4
-0
src/SuperimposeMesh/src/Model.cpp
src/SuperimposeMesh/src/Model.cpp
+3
-1
src/SuperimposeMesh/src/SICAD.cpp
src/SuperimposeMesh/src/SICAD.cpp
+10
-0
No files found.
src/SuperimposeMesh/include/SuperimposeMesh/SICAD.h
View file @
7d1cc0c5
...
...
@@ -325,6 +325,8 @@ public:
int
getTilesCols
()
const
;
void
scale
(
const
float
&
f
);
/* FIXME
* Change pointer with smartpointers.
*/
...
...
@@ -414,6 +416,8 @@ private:
void
setWireframe
(
GLenum
mode
);
void
factorize_int
(
const
GLsizei
area
,
const
GLsizei
width_limit
,
const
GLsizei
height_limit
,
GLsizei
&
width
,
GLsizei
&
height
);
float
scaleFactor
{
1
};
};
#endif
/* SUPERIMPOSECAD_H */
src/SuperimposeMesh/src/Model.cpp
View file @
7d1cc0c5
...
...
@@ -94,7 +94,9 @@ Mesh Model::processMesh(aiMesh* mesh, const aiScene* scene)
/* Process vertex positions, normals and texture coordinates. */
vertex
.
Position
=
glm
::
vec3
(
mesh
->
mVertices
[
i
].
x
,
mesh
->
mVertices
[
i
].
y
,
mesh
->
mVertices
[
i
].
z
);
vertex
.
Normal
=
glm
::
vec3
(
mesh
->
mNormals
[
i
].
x
,
mesh
->
mNormals
[
i
].
y
,
mesh
->
mNormals
[
i
].
z
);
if
(
mesh
->
mNormals
)
vertex
.
Normal
=
glm
::
vec3
(
mesh
->
mNormals
[
i
].
x
,
mesh
->
mNormals
[
i
].
y
,
mesh
->
mNormals
[
i
].
z
);
/* Does the mesh contain texture coordinates? */
if
(
mesh
->
mTextureCoords
[
0
])
...
...
src/SuperimposeMesh/src/SICAD.cpp
View file @
7d1cc0c5
...
...
@@ -445,6 +445,10 @@ SICAD::~SICAD()
std
::
cout
<<
log_ID_
<<
"OpenGL resource deallocation completed!"
<<
std
::
endl
;
}
void
SICAD
::
scale
(
const
float
&
f
)
{
scaleFactor
=
f
;
}
bool
SICAD
::
getOglWindowShouldClose
()
{
...
...
@@ -514,6 +518,7 @@ bool SICAD::superimpose
model
[
3
][
0
]
=
pose
[
0
];
model
[
3
][
1
]
=
pose
[
1
];
model
[
3
][
2
]
=
pose
[
2
];
model
=
glm
::
scale
(
model
,
glm
::
vec3
(
scaleFactor
,
scaleFactor
,
scaleFactor
));
auto
iter_model
=
model_obj_
.
find
(
pair
.
first
);
if
(
iter_model
!=
model_obj_
.
end
())
...
...
@@ -637,6 +642,7 @@ bool SICAD::superimpose
model
[
3
][
0
]
=
static_cast
<
float
>
(
pose
[
0
]);
model
[
3
][
1
]
=
static_cast
<
float
>
(
pose
[
1
]);
model
[
3
][
2
]
=
static_cast
<
float
>
(
pose
[
2
]);
model
=
glm
::
scale
(
model
,
glm
::
vec3
(
scaleFactor
,
scaleFactor
,
scaleFactor
));
auto
iter_model
=
model_obj_
.
find
(
pair
.
first
);
if
(
iter_model
!=
model_obj_
.
end
())
...
...
@@ -796,6 +802,7 @@ bool SICAD::superimpose
model
[
3
][
0
]
=
pose
[
0
];
model
[
3
][
1
]
=
pose
[
1
];
model
[
3
][
2
]
=
pose
[
2
];
model
=
glm
::
scale
(
model
,
glm
::
vec3
(
scaleFactor
,
scaleFactor
,
scaleFactor
));
auto
iter_model
=
model_obj_
.
find
(
pair
.
first
);
if
(
iter_model
!=
model_obj_
.
end
())
...
...
@@ -908,6 +915,7 @@ bool SICAD::superimpose
model
[
3
][
0
]
=
pose
[
0
];
model
[
3
][
1
]
=
pose
[
1
];
model
[
3
][
2
]
=
pose
[
2
];
model
=
glm
::
scale
(
model
,
glm
::
vec3
(
scaleFactor
,
scaleFactor
,
scaleFactor
));
auto
iter_model
=
model_obj_
.
find
(
pair
.
first
);
if
(
iter_model
!=
model_obj_
.
end
())
...
...
@@ -1026,6 +1034,7 @@ bool SICAD::superimpose
model
[
3
][
0
]
=
static_cast
<
float
>
(
pose
[
0
]);
model
[
3
][
1
]
=
static_cast
<
float
>
(
pose
[
1
]);
model
[
3
][
2
]
=
static_cast
<
float
>
(
pose
[
2
]);
model
=
glm
::
scale
(
model
,
glm
::
vec3
(
scaleFactor
,
scaleFactor
,
scaleFactor
));
auto
iter_model
=
model_obj_
.
find
(
pair
.
first
);
if
(
iter_model
!=
model_obj_
.
end
())
...
...
@@ -1151,6 +1160,7 @@ bool SICAD::superimpose
model
[
3
][
0
]
=
static_cast
<
float
>
(
pose
[
0
]);
model
[
3
][
1
]
=
static_cast
<
float
>
(
pose
[
1
]);
model
[
3
][
2
]
=
static_cast
<
float
>
(
pose
[
2
]);
model
=
glm
::
scale
(
model
,
glm
::
vec3
(
scaleFactor
,
scaleFactor
,
scaleFactor
));
auto
iter_model
=
model_obj_
.
find
(
pair
.
first
);
if
(
iter_model
!=
model_obj_
.
end
())
...
...
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