Commit 25aa028e authored by Matthias Möller's avatar Matthias Möller
Browse files

- fixes picking color problem

#refs 939

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14760 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c1bc6783
...@@ -328,6 +328,9 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod ...@@ -328,6 +328,9 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod
// draw all joint positions // draw all joint positions
glPointSize(12); glPointSize(12);
//we will set the specular color, otherwise the color cannot be seen
ACG::Vec4f oldSpecular = _state.specular_color();
for(it = skeleton_.begin(); it != skeleton_.end(); ++it) for(it = skeleton_.begin(); it != skeleton_.end(); ++it)
{ {
...@@ -336,8 +339,7 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod ...@@ -336,8 +339,7 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod
if ( (*it)->selected() ) if ( (*it)->selected() )
{ {
_state.set_diffuse_color(ACG::Vec4f(1.0, 0.0, 0.0 ,1.0)); _state.set_diffuse_color(ACG::Vec4f(1.0, 0.0, 0.0 ,1.0));
_state.set_ambient_color(ACG::Vec4f(1.0, 0.0, 0.0 ,1.0)); _state.set_specular_color(ACG::Vec4f(1.0, 0.0, 0.0 ,1.0));
_state.set_base_color(ACG::Vec4f(1.0, 0.0, 0.0 ,1.0));
} }
else { else {
// If it is the root joint, it will get some kind of orange color // If it is the root joint, it will get some kind of orange color
...@@ -346,13 +348,11 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod ...@@ -346,13 +348,11 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod
{ {
ACG::Vec4f root_color = ACG::Vec4f(1.0, 0.66, 0.0 ,1.0); ACG::Vec4f root_color = ACG::Vec4f(1.0, 0.66, 0.0 ,1.0);
_state.set_diffuse_color(root_color); _state.set_diffuse_color(root_color);
_state.set_ambient_color(root_color); _state.set_specular_color(root_color);
_state.set_base_color(root_color);
} }
else { else {
_state.set_diffuse_color(ACG::Vec4f(jointColor[0], jointColor[1] , jointColor[2], 1.0)); _state.set_diffuse_color(ACG::Vec4f(jointColor[0], jointColor[1] , jointColor[2], 1.0));
_state.set_ambient_color(ACG::Vec4f(jointColor[0], jointColor[1] , jointColor[2], 1.0)); _state.set_specular_color(ACG::Vec4f(jointColor[0], jointColor[1] , jointColor[2], 1.0));
_state.set_base_color(ACG::Vec4f(jointColor[0], jointColor[1] , jointColor[2], 1.0));
} }
} }
...@@ -380,6 +380,8 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod ...@@ -380,6 +380,8 @@ void SkeletonNodeT<SkeletonType>::draw(GLState& _state, const DrawModes::DrawMod
} }
_state.set_specular_color(oldSpecular);
// draw the local coordinate frames // draw the local coordinate frames
if(bCoordFramesVisible_) if(bCoordFramesVisible_)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment