Is there a way to directly get script representation of a Cairo drawing without saving the script to a file in C++?
I'm trying to get the script in order to do test by comparing scripts. Have tried cairo_script_create_for_stream but using streaming seems a little bit overkill for my use case.
Related
I have a custom graph algorithm and graph with some additional data in it, and I want to create a tool which creates this graph (Shape and size will be asked via UI) and then modifies it in some way. I tried simple forms and then processing the data with python, outputting and showing a graphviz converted to png. Graphviz makes edgeless graphs in an ugly way - they are in one line.
My goal is to create something more interactive, and user friendlier. My friends recommended me to do this in Unity, although, I have no experience with it. And internet recommends me javascript, but I have been always avoiding web as much as I could... So my Weapons are: Python, Java, C++ (I prefer Python). The tool is not meant to be commercial, it is for educational purposes only. Maybe there is really some simple way I am still missing. I want something similar to this: https://www.cs.usfca.edu/~galles/visualization/BTree.html
I want to create a framework for automated rendering tests for video games.
I want to test an application that normally renders to a window with OpenGL. Instead, I want it to render into image files for further evaluation. I want to do this on a Linux server with no GPU.
How can I do this with minimal impact on the evaluated application?
Some remarks for clarity:
The OpenGL version is 2.1, so software rendering with Mesa should be possible.
Preferably, I don't want to change any of the application code. If there is a solution that allows me to emulate a X server or something like that, I would prefer it.
I don't want to change any of the rendering code. If it is really necessary, I can change the way I initialize OpenGL, but after that, I want to execute arbitrary OpenGL code.
Ideally, your answer would explain how to set up an environment on a headless Linux server that allows me to start arbitrary OpenGL binaries and render its output into images. If that's not possible, I am open for any suggestions.
Use Xvfb for your X server. The installation of Mesa deployed on any modern Linux distribution should automatically fall back to software rasterization if no supported GPU is found. You can take screenshots with any X11 screen grabber program; heck even ffmpeg -i x11grab will work.
fbdev/miniglx might be something that you are looking for. http://www.mesa3d.org/fbdev-dri.html I haven't used it so I have no idea if it works for your purpose or not.
Alternative is to just start and xserver without any desktop environment with xinit. That setup is using well tested code paths making it better suited for running your test. miniglx might have bugs which none has noticed because it isn't used everyday.
To capture the rendering output to images could be done with LD_PRELOAD trick to wrap glXSwapBuffers. Basic idea is to add your own swapbuffers function in between your application and gl library where you can use glReadPixels to download rendered frame and then use your favorite image library to write that data to image/video files. After the glReadPixels has completed you can call to library glXSwapBuffers to make swap happen like it would happen in real desktop.
The prog subdirectory has been removed from main git repository and you can find it from git://anongit.freedesktop.org/git/mesa/demos instead.
Im learning openGL, basically ive created an object in Maya, im wondering how i go about exporting it, and loading it into my application ive created (it is simply a plain square room with different coloured walls at the moment.
OpenGL doesn't have the concept of models. You'll have to write your own model loader, or use one that's already out there. If you opt for writing your own, you should probably export as .obj, that's a fairly simple text based format.
for a university project I have to compute a 3D mesh, then display it.
By mesh I mean a list of triangles, where each point has a specific elevation.
What is the easiest tool that exists both on windows and linux that would allow me to display such a mesh?
I just want to be able to visualize the mesh and rotate it, and I can code any specific mesh format needed to be used as an input.
What I mostly want is a tool that is easy to install for the final user of my program.
Almost every tool reads the .obj format, for example MeshMan, MeshLab and ArtOfIllusion. They all work under Windows and Linux. Geomview (.off-Files) is also great, but hard to install under Windows.
I'm using for this purpose osgviewer from OpenSceneGraph
I wouldn't know about the easiest tool, but have you tried Blender? It's cross platform.
There are some standard file formats for triangle meshes. Try outputing to .ply file and using one of the existing viewers for that.
I tend to use VTK file formats since I work in scientific visualization; that would be overkill for you.
In fact, I wrote a VTK/QT based app for viewing meshes that can handle .ply files https://github.com/HalCanary/vtkviewer.
I am writing a program to real time convert between AMR-nb and ILBC. As I would like to convert it in real time, I don't want any files to be generated. calling shell by STDIN/STDOUT/piping or call program library (JAVA/node.js) directly are preferred.
I found that ffmpeg/sox do not support both formats. What ways do you think I can use to convert between them?