mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-19 14:19:57 +01:00
Improve MIXING view UX
Slight change of opacity of Mixing icon of source (stipple) when becoming non visible. Mouse over highlight on circular buttons in Mixing circle.
This commit is contained in:
@@ -96,30 +96,32 @@ MixingView::MixingView() : View(MIXING), limbo_scale_(MIXING_MIN_THRESHOLD)
|
|||||||
|
|
||||||
// Mixing scene foreground
|
// Mixing scene foreground
|
||||||
|
|
||||||
// button frame (non interactive; no picking detected on Mesh)
|
|
||||||
Mesh *tmp = new Mesh("mesh/disk.ply");
|
|
||||||
tmp->scale_ = glm::vec3(0.033f, 0.033f, 1.f);
|
|
||||||
tmp->translation_ = glm::vec3(0.f, 1.f, 0.f);
|
|
||||||
tmp->shader()->color = glm::vec4( COLOR_CIRCLE, 0.9f );
|
|
||||||
scene.fg()->attach(tmp);
|
|
||||||
// interactive button
|
// interactive button
|
||||||
button_white_ = new Disk();
|
button_white_ = new Disk();
|
||||||
button_white_->scale_ = glm::vec3(0.026f, 0.026f, 1.f);
|
button_white_->scale_ = glm::vec3(0.035f, 0.035f, 1.f);
|
||||||
button_white_->translation_ = glm::vec3(0.f, 1.f, 0.f);
|
button_white_->translation_ = glm::vec3(0.f, 1.f, 0.f);
|
||||||
button_white_->color = glm::vec4( 0.85f, 0.85f, 0.85f, 1.0f );
|
button_white_->color = glm::vec4( COLOR_CIRCLE, 1.0f );
|
||||||
scene.fg()->attach(button_white_);
|
scene.fg()->attach(button_white_);
|
||||||
// button frame
|
// button color WHITE (non interactive; no picking detected on Mesh)
|
||||||
tmp = new Mesh("mesh/disk.ply");
|
Mesh *tmp = new Mesh("mesh/disk.ply");
|
||||||
tmp->scale_ = glm::vec3(0.033f, 0.033f, 1.f);
|
tmp->scale_ = glm::vec3(0.028f, 0.028f, 1.f);
|
||||||
tmp->translation_ = glm::vec3(0.f, -1.f, 0.f);
|
tmp->translation_ = glm::vec3(0.f, 1.f, 0.f);
|
||||||
tmp->shader()->color = glm::vec4( COLOR_CIRCLE, 0.9f );
|
tmp->shader()->color = glm::vec4( 0.85f, 0.85f, 0.85f, 1.f );
|
||||||
scene.fg()->attach(tmp);
|
scene.fg()->attach(tmp);
|
||||||
|
|
||||||
// interactive button
|
// interactive button
|
||||||
button_black_ = new Disk();
|
button_black_ = new Disk();
|
||||||
button_black_->scale_ = glm::vec3(0.026f, 0.026f, 1.f);
|
button_black_->scale_ = glm::vec3(0.035f, 0.035f, 1.f);
|
||||||
button_black_->translation_ = glm::vec3(0.f, -1.f, 0.f);
|
button_black_->translation_ = glm::vec3(0.f, -1.f, 0.f);
|
||||||
button_black_->color = glm::vec4( 0.1f, 0.1f, 0.1f, 1.0f );
|
button_black_->color = glm::vec4( COLOR_CIRCLE, 1.0f );
|
||||||
scene.fg()->attach(button_black_);
|
scene.fg()->attach(button_black_);
|
||||||
|
// button color BLACK (non interactive; no picking detected on Mesh)
|
||||||
|
tmp = new Mesh("mesh/disk.ply");
|
||||||
|
tmp->scale_ = glm::vec3(0.028f, 0.028f, 1.f);
|
||||||
|
tmp->translation_ = glm::vec3(0.f, -1.f, 0.f);
|
||||||
|
tmp->shader()->color = glm::vec4( 0.1f, 0.1f, 0.1f, 1.f );
|
||||||
|
scene.fg()->attach(tmp);
|
||||||
|
|
||||||
// moving slider
|
// moving slider
|
||||||
slider_root_ = new Group;
|
slider_root_ = new Group;
|
||||||
scene.fg()->attach(slider_root_);
|
scene.fg()->attach(slider_root_);
|
||||||
@@ -581,7 +583,7 @@ View::Cursor MixingView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::pai
|
|||||||
std::ostringstream info;
|
std::ostringstream info;
|
||||||
if (s->active()) {
|
if (s->active()) {
|
||||||
info << "Alpha " << std::fixed << std::setprecision(3) << s->blendingShader()->color.a << " ";
|
info << "Alpha " << std::fixed << std::setprecision(3) << s->blendingShader()->color.a << " ";
|
||||||
info << ( (s->blendingShader()->color.a > 0.f) ? ICON_FA_EYE : ICON_FA_EYE_SLASH);
|
info << ( (s->blendingShader()->color.a > 0.f) ? ICON_FA_SUN : ICON_FA_CLOUD_SUN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
info << "Inactive " << ICON_FA_SNOWFLAKE;
|
info << "Inactive " << ICON_FA_SNOWFLAKE;
|
||||||
@@ -631,6 +633,15 @@ View::Cursor MixingView::over (glm::vec2 pos)
|
|||||||
limbo_down_->shader()->color = glm::vec4( COLOR_CIRCLE_ARROW, 0.01f );
|
limbo_down_->shader()->color = glm::vec4( COLOR_CIRCLE_ARROW, 0.01f );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( pick.first == button_white_ )
|
||||||
|
button_white_->color = glm::vec4( COLOR_CIRCLE_OVER, 1.f );
|
||||||
|
else
|
||||||
|
button_white_->color = glm::vec4( COLOR_CIRCLE, 1.f );
|
||||||
|
|
||||||
|
if ( pick.first == button_black_ )
|
||||||
|
button_black_->color = glm::vec4( COLOR_CIRCLE_OVER, 1.f );
|
||||||
|
else
|
||||||
|
button_black_->color = glm::vec4( COLOR_CIRCLE, 1.f );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -748,12 +748,11 @@ void Source::update(float dt)
|
|||||||
// use the sinusoidal transfer function
|
// use the sinusoidal transfer function
|
||||||
blendingshader_->color = glm::vec4(1.f, 1.f, 1.f, SourceCore::alphaFromCordinates( dist.x, dist.y ));
|
blendingshader_->color = glm::vec4(1.f, 1.f, 1.f, SourceCore::alphaFromCordinates( dist.x, dist.y ));
|
||||||
mixingshader_->color = blendingshader_->color;
|
mixingshader_->color = blendingshader_->color;
|
||||||
|
|
||||||
// adjust scale of mixing icon : smaller if not active
|
// adjust scale of mixing icon : smaller if not active
|
||||||
groups_[View::MIXING]->scale_ = glm::vec3(MIXING_ICON_SCALE) - ( active_ ? glm::vec3(0.f, 0.f, 0.f) : glm::vec3(0.03f, 0.03f, 0.f) );
|
groups_[View::MIXING]->scale_ = glm::vec3(MIXING_ICON_SCALE) - ( active_ ? glm::vec3(0.f, 0.f, 0.f) : glm::vec3(0.03f, 0.03f, 0.f) );
|
||||||
|
// change stippling intensity of source in mixing view to indicate if shown in scene
|
||||||
// highlight color of source in mixing circle only when visible
|
mixingshader_->stipple = (blendingshader_->color.a > 0.f) ? 1.f : 0.75f;
|
||||||
Frame *f = dynamic_cast<Frame *>(frames_[View::MIXING]->child(1));
|
|
||||||
if (f) f->color = blendingshader_->color.a > 0.f ? glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f) : glm::vec4( COLOR_DEFAULT_SOURCE, 1.f);;
|
|
||||||
|
|
||||||
// MODIFY geometry based on GEOMETRY node
|
// MODIFY geometry based on GEOMETRY node
|
||||||
groups_[View::RENDERING]->translation_ = groups_[View::GEOMETRY]->translation_;
|
groups_[View::RENDERING]->translation_ = groups_[View::GEOMETRY]->translation_;
|
||||||
|
|||||||
Reference in New Issue
Block a user