mirror of https://github.com/CGAL/cgal
Fix color in shader and spheres color depends on the in_dimension of the associated vertex.
This commit is contained in:
parent
1d109f9abd
commit
724b18fb51
|
|
@ -1497,7 +1497,18 @@ void Scene_c3t3_item_priv::computeSpheres()
|
||||||
if(red)
|
if(red)
|
||||||
c = QColor(Qt::red);
|
c = QColor(Qt::red);
|
||||||
else
|
else
|
||||||
c = spheres->color().darker(250);
|
c = QColor::fromHsv(120, 200,200,255);
|
||||||
|
switch(vit->in_dimension())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
c = QColor::fromHsv((c.hue()+120)%360, c.saturation(),c.lightness(), c.alpha());
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
c.setRgb(50,50,50,255);
|
||||||
|
}
|
||||||
|
|
||||||
const qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(QGLViewer::QGLViewerPool().first())->offset();
|
const qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(QGLViewer::QGLViewerPool().first())->offset();
|
||||||
Kernel::Point_3 center(vit->point().point().x()+offset.x,
|
Kernel::Point_3 center(vit->point().point().x()+offset.x,
|
||||||
vit->point().point().y()+offset.y,
|
vit->point().point().y()+offset.y,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ uniform bool is_selected;
|
||||||
void main(void) {
|
void main(void) {
|
||||||
if(color.w<0)
|
if(color.w<0)
|
||||||
{
|
{
|
||||||
vec4 my_color = vec4(color.xzy, 1.);
|
vec4 my_color = vec4(color.xyz, 1.);
|
||||||
highp vec3 L = light_pos.xyz - fP.xyz;
|
highp vec3 L = light_pos.xyz - fP.xyz;
|
||||||
highp vec3 V = -fP.xyz;
|
highp vec3 V = -fP.xyz;
|
||||||
highp vec3 N;
|
highp vec3 N;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue