On Fri, Apr 2, 2010 at 2:35 PM, Osiloke Emoekpere <osiloke_e@skuuled.com> wrote:Hi,@josh -> thanks for your reply and sorry for the caps
Sorry if i appeared to come out strong, i was only trying to highlight the part i wantedto focus on (did not know i was offending anyone). The caps thing was of no relevance to thetone of "my voice".
No worries, all caps is usually frowned upon on mailing lists/forums/etc., now you know.
i really like the operating system and i'm in the process of loving it.
Glad to hear it :)
like soin shape_marker.cppThe dummy image is created when shape_marker is created in the constructorstd::stringstream ss;ss << "SHAPETEX-h" << name;texName = ss.str();empty_image_.load("no_image.png", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);// Create the texturetexture_ = Ogre::TextureManager::getSingleton().createManual(texName, // nameOgre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,Ogre::TEX_TYPE_2D, // type256, 256, // width & height0, // number of mipmapsempty_image_.getFormat(), // pixel formatOgre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE); // usage; should be TU_DYNAMIC_WRITE_ONLY_DISCARDABLE forIn order to load the image into the texture and then apply it to the shapes material,i do the following
PLEASE NOTE:I also tried the blitfromemory to copy the image data to the texture (resulted in some garbled results and later caused a seg error)
void ShapeMarker::setTexture(const Ogre::Image &img){//I first deleted the existing texture if there was anyif (!texture_.isNull()){Ogre::TextureManager::getSingleton().remove((Ogre::ResourcePtr&)texture_);texture_.setNull();}texture_ = Ogre::TextureManager::getSingleton().loadImage(texName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,img);//Then loaded the texture like so//texture_(new Ogre::Texture());textured_=true;/// Testing. Apply Texture to Shape, i may be wrong hereOgre::TexturePtr text_or(tex); //i thought copying it makes a differenceOgre::MaterialPtr material_ = shape_->getMaterial();//get material of already existing shapematerial_->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();material_->getTechnique(0)->getPass(0)->createTextureUnitState(text_or->getName());ROS_INFO("Texture Applied %s", text_or->getName().c_str());}So these where the steps i took to try and create my systemAny input and criticisms would be highly appreciated.
I don't see anything blatantly wrong after a quick look through the code. Does the "no image" texture also not show up, or just the dynamic one?
It shows the first image it receives, but subsequent tries to change the image using the
same route to create continuous updates of the texture fails
It just does not update, instead it segs faults sometimes. I don't know where i'm crossing memory locations
If the "no image" texture also doesn't show up, the mesh you're using for the plane (are you just using a really flat box?) probably doesn't have texture coordinates on it -- you'd have to add them in a 3d modeling program or generate coordinates after it's loaded.
For the plane, i am using an ogre 2d plane which i created as mesh on the ogre_tools::initialization
Josh
_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users