Write texture mapped obj file to disk with VTK - opengl

I am using VTK to read an obj file, texture map the 3D model and transform it to another view (by applying rotateY/X/Z transforms to vtkActors) and writing it to file using vtkwindowtoImageFilter. Due to this pipeline, the rendered image is displayed on the screen before being written to file. Is there a way to do the same pipeline without the image being displayed on screen ?

If you are using VTK 5.10 or earlier, you can reander the geometry off screen.
I am not quite sure if this is what you are looking for. I am new to vtk and I found the above link looking for a way to convert a triangular surface to volume data, ie, to voxelize the surface. All profile I found on the internet is about using vtkwindowtoImageFilter to obtain a 2D section of the screen, have you worked out a way to access 3D data of the rendered window? Please tell me about that.

Related

Unreal: How to access image in MediaTexture with C++?

I'm currently using unreal read from video and cameras. I got a Media Player and Media Texture alongside with it.
I'm aware that It is possible to read pixels from Texture2D. The problem is mediaTexture is derived from Texture. Thus It cannot be casted to Texture2D. And I have no idea how to get pixel data from it.
Thanks for any reply! C++ and blueprint are both welcomed!
At present, it seems like the only way is to render the media texture to a render target, and then read the result with ReadPixels. This is how Epic does it for their OpenCV Calibration

Save a Mesh file under VTK

I'm trying to generate a mesh from a 3d volume.
I processed on VTK, using Marching Cube (vtkMarchingCubes.h); but I still can't found how to save the result view, as vtk file!
any idea
I appreciate your help.
You can use vtkPolyDataWriter or vtkXMLPolyDataWriter to write the mesh data to files.
If you want the write the rendered output in a window you can use vtkWindowToImageFilter as a starting point
You can find some examples here
Mayavi is a very nice tool to visualize the files.

LibGDX: BufferedImage into Texture

I'm trying to play videos within a LibGDX application. I've managed to load the individual video frames sequentially into a java.awt.BufferedImage using Xuggler.
Now I'm stuck trying to get that into a LibGDX Texture. Anyone know a way to do this?
I managed to find these two LibGDX files that happen to use BufferedImage's, however can't see how to use this to get my data into a Texture :(
LibGDX JoglPixmap.java
LibGDX JoglTexture.java
as soon as you transformed your bufferedImage to a pixmap just use the Texture constructor passing in a pixmap:
Texture newTexture = new Texture(myPixmap);
There are methods to construct an empty Pixmap and draw onto it. Use this pixmap then as described above
If you are using LibGDX, I have to say that I don't recommend also using BufferedImages (from Java2D), instead you could use a Pixmap, or if you really do need BufferedImages, then I guess you could use ImageIO to save the image to a file, bring the file back in as a texture, then delete the file, but that seems quite hacky and inefficient.

how to write displaying and selecting image using opengl?

I want to write a simple application using opengl under linux. I want to open the image and allow the user to interactively select a rectangle. After that user can save it to a specific location.
Could anyone give me the startup links or sample code.
From your question I take it that you think OpenGL was some kind of imaging library. This is not the case.
OpenGL is meant only for drawing nice pictures to the screen. It deals neither with image loading, or storing. It's also not meant for imaging operations like cropping (although this is actually quite easy to implement with OpenGL).
Regarding your question: OpenGL can be used for the "display the image" and "draw a rectangle around it" part. Loading and saving the image, and doing the actual crop is not to be done using OpenGL.

how could I load a bitmap file in a video feed?

I am using artoolkit to create an augmented reality based project.I can load vrml 3d objects in the video feed using openvrml.
Now I wanted to load a bitmap or any other image file like jpg,png etc file on the marker in the video feed.How do I go about achieving this?
The usual approach is using an overlay.
Just make a VRML 'model' consisting of a single quad with a texture corresponding to your image file. Your existing VRML machinery should take care of the rest.