Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
322651da
Commit
322651da
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#63
] Fix scene mesh translation
parent
3d6878e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!51
Resolve "Laden mehrer Meshes mit Materials und Textures"
Pipeline
#25755
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+3
-3
3 additions, 3 deletions
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
projects/first_scene/src/main.cpp
+7
-4
7 additions, 4 deletions
projects/first_scene/src/main.cpp
with
10 additions
and
7 deletions
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+
3
−
3
View file @
322651da
...
...
@@ -330,13 +330,13 @@ int loadScene(const std::string &path, Scene &scene){
std
::
vector
<
Sampler
>
samplers
;
std
::
vector
<
Mesh
>
meshes
;
std
::
vector
<
VertexGroup
>
vertexGroups
;
std
::
vector
<
int
>
vertexGroupsIndex
;
int
groupCount
=
0
;
Mesh
mesh
=
{};
for
(
int
i
=
0
;
i
<
sceneObjects
.
meshes
.
size
();
i
++
){
std
::
vector
<
int
>
vertexGroupsIndices
;
fx
::
gltf
::
Mesh
const
&
objectMesh
=
sceneObjects
.
meshes
[
i
];
for
(
int
j
=
0
;
j
<
objectMesh
.
primitives
.
size
();
j
++
){
...
...
@@ -440,12 +440,12 @@ int loadScene(const std::string &path, Scene &scene){
static_cast
<
uint8_t
>
(
objectPrimitive
.
material
)
});
vertexGroupsIndices
.
push_back
(
groupCount
);
groupCount
++
;
vertexGroupsIndex
.
push_back
(
groupCount
);
}
mesh
.
name
=
sceneObjects
.
meshes
[
i
].
name
;
mesh
.
vertexGroups
=
vertexGroupsInd
ex
;
mesh
.
vertexGroups
=
vertexGroupsInd
ices
;
meshes
.
push_back
(
mesh
);
}
...
...
This diff is collapsed.
Click to expand it.
projects/first_scene/src/main.cpp
+
7
−
4
View file @
322651da
...
...
@@ -180,11 +180,14 @@ int main(int argc, const char** argv) {
}
std
::
vector
<
glm
::
mat4
>
modelMatrices
;
modelMatrices
.
clear
();
for
(
int
m
=
0
;
m
<
scene
.
meshes
.
size
();
m
++
){
modelMatrices
.
push_back
(
arrayTo4x4Matrix
(
scene
.
meshes
[
m
].
modelMatrix
));
modelMatrices
.
resize
(
scene
.
vertexGroups
.
size
(),
glm
::
mat4
(
1.
f
));
for
(
const
auto
&
mesh
:
scene
.
meshes
)
{
const
glm
::
mat4
m
=
arrayTo4x4Matrix
(
mesh
.
modelMatrix
);
for
(
const
auto
&
vertexGroupIndex
:
mesh
.
vertexGroups
)
{
modelMatrices
[
vertexGroupIndex
]
=
m
;
}
}
std
::
vector
<
glm
::
mat4
>
mvp
;
std
::
vector
<
glm
::
mat4
>
mvp
;
auto
start
=
std
::
chrono
::
system_clock
::
now
();
while
(
window
.
isWindowOpen
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment