Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ofxaddons
ofxCloudLib
Commits
15bc72e9
Commit
15bc72e9
authored
Dec 17, 2017
by
artificiel
Browse files
ClientsManager: crop la zone selon min/max
parent
f7c423b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ofxCloudLib/ClientsManager.cpp
View file @
15bc72e9
...
...
@@ -11,7 +11,7 @@ ClientsManager::ClientsManager()
ofAddListener
(
browser_
.
serviceNewE
,
this
,
&
ClientsManager
::
service_new
);
ofAddListener
(
browser_
.
serviceRemoveE
,
this
,
&
ClientsManager
::
service_remove
);
sticky_mesh_parameters_
.
setName
(
"
S
ticky
M
esh"
);
sticky_mesh_parameters_
.
setName
(
"
s
ticky
_m
esh"
);
sticky_mesh_parameters_
.
add
(
sticky_mesh_enable_
.
set
(
"Enable"
,
1
));
sticky_mesh_parameters_
.
add
(
sticky_mesh_input_prob_
.
set
(
"Input prob"
,
.01
,
0
,
1
));
sticky_mesh_parameters_
.
add
(
sticky_mesh_attenuation_amnt_
.
set
(
"Att amnt"
,
.05
,
0
,
.5
));
...
...
@@ -21,6 +21,10 @@ ClientsManager::ClientsManager()
sticky_mesh_parameters_
.
add
(
sticky_mesh_dither_amnt_
.
set
(
"Dither amnt"
,
0
,
0
,
.1
));
sticky_mesh_parameters_
.
add
(
sticky_mesh_color_
.
set
(
"Color"
,
ofColor
::
yellow
,
ofColor
::
black
,
ofColor
::
white
));
parameters_
.
add
(
sticky_mesh_parameters_
);
parameters_
.
add
(
crop_left_
.
set
(
"crop_left"
,
0
,
-
10
,
10
));
parameters_
.
add
(
crop_right_
.
set
(
"crop_right"
,
0
,
-
10
,
10
));
parameters_
.
add
(
crop_top_
.
set
(
"crop_top"
,
0
,
-
10
,
10
));
parameters_
.
add
(
crop_bottom_
.
set
(
"crop_bottom"
,
0
,
-
10
,
10
));
sticky_mesh_
.
setMode
(
OF_PRIMITIVE_POINTS
);
parameters_
.
setName
(
"ClientsManager"
);
...
...
@@ -115,11 +119,16 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
if
(
client
.
second
->
enabled_
)
{
ofLogNotice
(
"ClientManager"
)
<<
"merging "
<<
client
.
second
->
client_name_
<<
" with "
<<
client
.
second
->
get_mesh
().
getNumVertices
();
for
(
const
auto
&
v
:
client
.
second
->
get_mesh
().
getVertices
())
{
mesh
.
addVertex
(
v
);
if
(
ofRandom
(
1.0
)
<
sticky_mesh_input_prob_
)
{
tmp_mesh
.
addVertex
(
v
);
tmp_mesh
.
addColor
(
sticky_mesh_color_
);
if
(
v
.
x
>
crop_left_
&&
v
.
x
<
crop_right_
)
{
mesh
.
addVertex
(
v
);
if
(
ofRandom
(
1.0
)
<
sticky_mesh_input_prob_
)
{
tmp_mesh
.
addVertex
(
v
);
tmp_mesh
.
addColor
(
sticky_mesh_color_
);
}
}
}
}
...
...
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