[Ves] Adding Texture To 3D Model Using jpg Texture Image
Aashish Chaudhary
aashish.chaudhary at kitware.com
Fri Feb 15 22:39:31 EST 2013
vtkSmartPointer<vtkUnsignedCharArray> pixels =
vtkUnsignedCharArray::SafeDownCast(image->GetPointData()->GetScalars()); //
image is vtkImageData*
vesImage::Ptr vesimage =
vesKiwiDataConversionTools::ImageFromPixels(pixels, width, height); // for
given image width and height
texture->setImage(vesimage)
On Fri, Feb 15, 2013 at 9:38 PM, shamsudheen <shamsutk87 at gmail.com> wrote:
> Hi All,
>
> Im using *vesKiwiViewerApp* in my iOS application.
>
> I would like a add *Texture* to my 3D model which is rendered through "*
> **bool loadDataset(const std::string& filename);"*
> *
> *
> I have found one method as " *void setTexture(vesSharedPtr<vesTexture>
> texture);" *in *vesKiwiPolyDataRepresentation *class.
>
> However Im unable to create *vesImage *from my* **.jpg *texture image* *
> file*. *
> *
> *
> Im looking some thing like* vtkPNGReader *in* VES.*
> *
> *
> Any help on this is appreciated.
> *
> *
> *my code is*
> *
> *
> *
> vesKiwiPolyDataRepresentation* polyDataRepresentation =
> self->renderer.app->getKiwiPolyDataRepresentation(0);
>
> vesSharedPtr<vesTexture> texture =
> polyDataRepresentation->texture();
>
>
> vesSharedPtr<vesImage> textureImage = //here i would like create
> vesImage pointer from my texture-color.jpg file
>
>
> texture->setImage(textureImage);
>
>
> polyDataRepresentation ->setTexture(texture);
> *
> *
> *
> *
> *
>
>
>
>
>
> _______________________________________________
> Ves mailing list
> Ves at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>
>
--
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130215/466811a4/attachment-0001.html>
More information about the Ves
mailing list