Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glow-samples
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Glow
glow-samples
Commits
0bff61ed
Commit
0bff61ed
authored
3 years ago
by
Aaron Kreuzberg
Browse files
Options
Downloads
Patches
Plain Diff
picking visualization: outline
parent
7886eff7
No related branches found
No related tags found
1 merge request
!16
picking samples
Pipeline
#18104
passed
3 years ago
Stage: Build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
extern/glow-extras
+1
-1
1 addition, 1 deletion
extern/glow-extras
samples/basic/viewer/main.cc
+15
-3
15 additions, 3 deletions
samples/basic/viewer/main.cc
with
16 additions
and
4 deletions
glow-extras
@
333713c0
Subproject commit
e904896aaca745dbedc2b9d2baa19eee971f6fcb
Subproject commit
333713c0306c75a84b1d0e6417e107c47421aa7e
This diff is collapsed.
Click to expand it.
samples/basic/viewer/main.cc
+
15
−
3
View file @
0bff61ed
...
...
@@ -117,6 +117,18 @@ void simple_picking(pm::vertex_attribute<tg::pos3> const& pos, pm::face_attribut
std
::
cout
<<
"Something has been picked! ON_LEFT_CLICK"
<<
"ID: "
<<
face_id
<<
std
::
endl
;
std
::
cout
<<
"World_Position"
<<
world_pos
<<
std
::
endl
;
std
::
cout
<<
"Normal"
<<
normal
<<
std
::
endl
;
return
;
}));
}
{
// Only on_left_click callback defined - PointRenderable
gv
::
view
(
gv
::
points
(
pos
),
gv
::
pick
().
on_left_click
([
&
](
uint32_t
face_id
,
tg
::
pos3
world_pos
,
tg
::
vec3
normal
)
{
std
::
cout
<<
"Something has been picked! ON_LEFT_CLICK"
<<
"ID: "
<<
face_id
<<
std
::
endl
;
std
::
cout
<<
"World_Position"
<<
world_pos
<<
std
::
endl
;
std
::
cout
<<
"Normal"
<<
normal
<<
std
::
endl
;
return
;
}));
}
...
...
@@ -1145,9 +1157,9 @@ int main()
// load a sample polymesh mesh
pm
::
Mesh
m
;
auto
pos
=
m
.
vertices
().
make_attribute
<
tg
::
pos3
>
();
//
load(dataPath + "suzanne.obj", m, pos);
pm
::
objects
::
add_cube
(
m
,
pos
);
//
normalize(pos); // make it -1..1*/
load
(
dataPath
+
"suzanne.obj"
,
m
,
pos
);
//
pm::objects::add_cube(m, pos);
normalize
(
pos
);
// make it -1..1*/
auto
col
=
pm
::
face_attribute
<
tg
::
color3
>
(
m
);
int
it
=
0
;
...
...
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