Base color of Simple Solids

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Base color of Simple Solids

Sawyer-3
I am trying to construct a banded construction barrel, using the cylinder
simple solid. I have created a texture file consisting of five horizontal
color bands (orange - white - orange - white - orange). This is working well
except that the flat sides of the cylinder are white and need to be orange
for correct representation.  If I change the color attribute of the cylinder
in the world file then the ends can be made to be orange but then the white
regions of the texture file are a light orange as well. I can make the bands
black  but this does not visually represent the object.

Is there any way to make both ends (or even just the top?) of the cylinder
orange and leave the bands white?

Thanks for any help.  

Sawyer Larkin


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: Base color of Simple Solids

Nate Koenig
Hi Sawyer,

The default texture environment is set to GL_MODULATE - which sort of
blends the object's color and the texture image. An alternative is
GL_REPLACE, which will only take the texture's color.

I'll add in a method to set this option on a per-object basis. For a
quick fix, you can edit the source code.
Look for:

      glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

in gazebo/server/bodies/CylinderGeom.cc

And replace GL_MODULATE with GL_REPLACE.

Now your cylinders will use the texture color one the curved surface,
and the base color on the caps.

-nate



On 10/22/05, Sawyer <[hidden email]> wrote:

> I am trying to construct a banded construction barrel, using the cylinder
> simple solid. I have created a texture file consisting of five horizontal
> color bands (orange - white - orange - white - orange). This is working well
> except that the flat sides of the cylinder are white and need to be orange
> for correct representation.  If I change the color attribute of the cylinder
> in the world file then the ends can be made to be orange but then the white
> regions of the texture file are a light orange as well. I can make the bands
> black  but this does not visually represent the object.
>
> Is there any way to make both ends (or even just the top?) of the cylinder
> orange and leave the bands white?
>
> Thanks for any help.
>
> Sawyer Larkin
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Playerstage-gazebo mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo