Displaying Quads in VTK

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

Displaying Quads in VTK

subhadip
Hi. I am trying to add a custom function 'addMyQuad' in the pcl_visualizer.h that can add textured quads to the render scene. I have got the main source for the adding texture from here and I have tested it and that's running fine. I am trying to add it to the existing visualizer class so that I can call it just like viewer->addSphere() etc or the other example in the tutorial given.

The problem is that the vtk actor (for the quad) gets added to the renderer but it doesn't show up in the final display window. I must be missing something small. Can you guys help me out? I've hit a roadblock.

I am including a minimal example here so that this can be tested
test.cpp - this is similar to the visualization example in the tutorials. removed unnecessary parts and added call to a function 'addMyQuad'. you need to link the location of a jpeg file
pcl_visualizer.h- i added a standalone function 'addMyQuad' to the base pcl_visualizer.h file. Either the entire file can be replaced or this function can be added.

Just a note - I'm running windows 7 64 and PCL 1.2

Thanks
Subhadip
Reply | Threaded
Open this post in threaded view
|

Re: Displaying Quads in VTK

Radu B. Rusu
Administrator
Subhadip,

Did you solve your problem?

Cheers,
Radu.
--
http://pointclouds.org

On 02/27/2012 10:38 AM, subhadip wrote:

> Hi. I am trying to add a custom function 'addMyQuad' in the pcl_visualizer.h
> that can add textured quads to the render scene. I have got the main source
> for the adding texture from
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TextureMapQuad here
> and I have tested it and that's running fine. I am trying to add it to the
> existing visualizer class so that I can call it just like
> viewer->addSphere() etc or the other example in the tutorial given.
>
> The problem is that the vtk actor (for the quad) gets added to the renderer
> but it doesn't show up in the final display window. I must be missing
> something small. Can you guys help me out? I've hit a roadblock.
>
> I am including a minimal example here so that this can be tested
> http://www.pcl-developers.org/file/n5519766/test.cpp test.cpp  - this is
> similar to the visualization example in the tutorials. removed unnecessary
> parts and added call to a function 'addMyQuad'. you need to link the
> location of a jpeg file
> http://www.pcl-developers.org/file/n5519766/pcl_visualizer.h
> pcl_visualizer.h - i added a standalone function 'addMyQuad' to the base
> pcl_visualizer.h file. Either the entire file can be replaced or this
> function can be added.
>
> Just a note - I'm running windows 7 64 and PCL 1.2
>
> Thanks
> Subhadip
>
> --
> View this message in context: http://www.pcl-developers.org/Displaying-Quads-in-VTK-tp5519766p5519766.html
> Sent from the Point Cloud Library (PCL) Developers mailing list archive at Nabble.com.
> _______________________________________________
> PCL-developers mailing list
> [hidden email]
> http://pointclouds.org/mailman/listinfo/pcl-developers
> http://pointclouds.org
_______________________________________________
PCL-developers mailing list
[hidden email]
http://pointclouds.org/mailman/listinfo/pcl-developers
http://pointclouds.org
Reply | Threaded
Open this post in threaded view
|

Re: Displaying Quads in VTK

subhadip
Unfortunately no.
I gave it some more time and posted a query on the vtk site as well but not much of help.
This would have been useful as I was trying to show the user the texture generated and applied to the surface (traingles) as a mode of feedback. But if nothing, the texture will be mapped to the triangles and stored in obj or some format.

a side question if it's ok -
It seems that this texture handling/mapping part of pcl-vtk still requires a lot of development. I am thinking of using osg instead. My final goal is to store and display all the texture mapped triangles in a common format such as .obj- does pcl have an easy enough approach? and it seems the greedy mesh generation produces a grey mesh  (i haven't tested anything on the mesh side myself). I was thinking of using gourad shading using the color of the triangle vertices if there is nothing in pcl by itself. Do you have any suggestions on this?
Reply | Threaded
Open this post in threaded view
|

Re: Displaying Quads in VTK

Radu B. Rusu
Administrator
Can you produce a small patch against trunk and a minimal test (see demo_shapes for an example) on the behavior that you
want to add, so we can give it a shot on our Linux boxes? I've seen situations where certain functionality needed some
massaging on Windows, and therefore I would like to see if it works in Linux first.

Cheers,
Radu.
--
http://pointclouds.org

On 03/11/2012 10:00 PM, subhadip wrote:

> Unfortunately no.
> I gave it some more time and posted a query on the vtk site as well but not
> much of help.
> This would have been useful as I was trying to show the user the texture
> generated and applied to the surface (traingles) as a mode of feedback. But
> if nothing, the texture will be mapped to the triangles and stored in obj or
> some format.
>
> a side question if it's ok -
> It seems that this texture handling/mapping part of pcl-vtk still requires a
> lot of development. I am thinking of using osg instead. My final goal is to
> store and display all the texture mapped triangles in a common format such
> as .obj- does pcl have an easy enough approach? and it seems the greedy mesh
> generation produces a grey mesh  (i haven't tested anything on the mesh side
> myself). I was thinking of using gourad shading using the color of the
> triangle vertices if there is nothing in pcl by itself. Do you have any
> suggestions on this?
>
> --
> View this message in context: http://www.pcl-developers.org/Displaying-Quads-in-VTK-tp5519766p5556637.html
> Sent from the Point Cloud Library (PCL) Developers mailing list archive at Nabble.com.
> _______________________________________________
> PCL-developers mailing list
> [hidden email]
> http://pointclouds.org/mailman/listinfo/pcl-developers
> http://pointclouds.org
_______________________________________________
PCL-developers mailing list
[hidden email]
http://pointclouds.org/mailman/listinfo/pcl-developers
http://pointclouds.org
Reply | Threaded
Open this post in threaded view
|

Re: Displaying Quads in VTK

subhadip
Sure I can do that - but this might take atleast a couple of weeks before I can take a look. (i am working on a different part of the project now). But I'll try.

Also do you have any advice on the side questions I asked in the previous post?

Thanks,
Subhadip
Reply | Threaded
Open this post in threaded view
|

Re: Displaying Quads in VTK

Radu B. Rusu
Administrator
Subhadip,

Regarding your other question: since PCL is a collection of libraries used for _processing_ data, we leave the
visualization to the experts. We are very fond of VTK and its active development, and we'd rather help improve VTK than
reinvent the wheel and do our own (we do have a lot of resources as a community, but we also have a lot of problems that
we're trying to solve :).

That being said (#1), we would like to hear more from you regarding which parts of pcl-vtk still need development, and
perhaps try to solve those. I am not familiar with OSG, and unless someone wants dearly to maintain a pcl_visualizer
backend for OSG, adding it as a dependency will just create havoc. :) In my experience, VTK is powerful enough to do all
the operations that we care about, minus some of the more modern VBO/GLSL stuff that we've been talking about in a
separate thread, but which are on a roadmap/todo list anyway. As I said, I would rather pick one platform, and try to
help improve it as much as I can, rather than fork :)

That being said (#2), I dislike the "one hat size fits all" paradigm, so if anyone does like to add extra backends for
visualization, but more importantly _maintain_ them, great! But first, I would try to discuss the extra needed
functionality with VTK developers (some which are on this mailing list) to see if they plan to add it anyway, instead of
trying to create my own. The first 70-80% of building a visualization engine is super easy, it's the remaining 20-30%
that sucks and you wish you'd never have done it to begin with. ;)

Cheers,
Radu.
--
http://pointclouds.org

On 03/12/2012 01:52 PM, subhadip wrote:

> Sure I can do that - but this might take atleast a couple of weeks before I
> can take a look. (i am working on a different part of the project now). But
> I'll try.
>
> Also do you have any advice on the side questions I asked in the previous
> post?
>
> Thanks,
> Subhadip
>
> --
> View this message in context: http://www.pcl-developers.org/Displaying-Quads-in-VTK-tp5519766p5559097.html
> Sent from the Point Cloud Library (PCL) Developers mailing list archive at Nabble.com.
> _______________________________________________
> PCL-developers mailing list
> [hidden email]
> http://pointclouds.org/mailman/listinfo/pcl-developers
> http://pointclouds.org
_______________________________________________
PCL-developers mailing list
[hidden email]
http://pointclouds.org/mailman/listinfo/pcl-developers
http://pointclouds.org