I have a vectorized Adobe Illustrator image that I would like to animate using custom xyz input (in this case simulated plot points that I would like to visualize over time, using a hand drawn picture/wireframe model) from e.g. a c++ program or perhaps even javascript application. Is there any (fairly straightforward) strategy to achieve this? E.g. using open GL or some other (open source) tool?
If you want to draw vectorized images you would need to use vector image renderer. The easiest way to do this is to use Flash since it has support vector drawing (one of the best) and really strong scripting language to do all sorts of things (anymate stuff based on input, etc) even 3d graphics.
The hard way of doing this is to use a custom library in c++ do draw vector grapics in opengl or directx. I can only speak of gameswf (opensource player for flash files) or scaleform. There two have support for swf files exported by flash. If you only need a renderer without any animation then there should be plenty of libraries out there (check out this thread)
Related
I want to draw 2D shapes in C++, probably not more advanced than rectangles!
I'm looking for a C++ API that will be simple and easy to use, as I don't need many advanced features such as image mapping etc.
I've read about cairographics.org Cairo and it looks very good. Before I start with it, would you recommend a possible alternative, or improvement on Cairo? I'm developing on Windows in VS 2013.
Thanks.
I am an openGL beginner. I need to build a c/c++ application which displays 3d models in augmented reality. For AR i'm using ARToolkit. In the app it must import 3d models built with modelling softwares like blender,sketchup etc.. the models might be .obj,.3ds,.collada(suggest me any others if any??).
ARToolkit mainly uses opengl to render(AFAIK), the 3d objects to camera input.
Is it possible to load 3d models/objects at runtime dynamically. what libraries are existing if any for this?
I want to have keyboard interaction with the models also where i can move specific parts of the model(eg: rrotate wheels of a car)
The models here maybe as simple as a simple house to character(man/woman).suggest me the resources i need for this and any technicalities i missed. I prefer if possible my code to work with opengl 1.4
You will need some import mechanism to import meshes in various formats into your runtime format. OpenGL (or DirectX) doesn't specify how your meshes must look on disk, and there is various stuff stored on disk that is not required for rendering. Basically, you need a way to get the vertex positions and attributes from the file, and optionally an index list (if you render using indexed triangle lists, which you probably should be doing.)
The easiest for sure is .obj, which is an ASCII format that you can easily parse and which is supported by many applications. Otherwise, look at libraries like Open Asset Import.
However, I would assume you are looking for an OpenGL based rendering system, which does the rendering for you as well as the mouse interaction. There are lot of existing engines you can use out there, for instance, Ogre3D or IrrLicht. IrrLicht is easy to use and provides support for a bunch of the formats you mentioned. It you must stick with ARToolkit for rendering, then you can probably easily convert the formats from either engine to whatever ARToolkit expects.
I'm very recomending you to try http://assimp.sourceforge.net/lib_html/
It supports a lot of open/not-very-open data formats, skelet-animation, affine transfer animation, etc.
I'm working on an Augmented Reality project that uses multiple markers to get positions for 3D models that I'm planning to overlay. (I'm doing this from scratch using OpenCV and I'm not using ARToolkit or any other off the shelf marker detection libraries).
Environment: Visual C++ 2008, Windows 7, Core2Duo 1GB ram, OpenCV 2.3
I want the 3D models to be manipulated by user so it will turn out to a sort of simulation.
For this I'm planning to use OpenGL. What are your suggestions, recommendations? Can the simulation part be done by using OpenGL itself or will i need to use something like OpenSceneGraph/ODE/Unity 3D/Ogre 3D?
This is for an academic project so better if I can produce more self-coded system rather than using off-the-shelf products.
it would seem that OpenGL is pretty enough for your needs (drawing a model with a specific colour and size).
If you're new to OpenGL, and you are not going to be using it for your future projects, it might be easier to use the old fixed-function pipeline, which already has the lighting and color system ready and doesn't require you to learn how to write shaders.
For your project, you will need a texture where you would copy the image from camera using glTexSubImage2D() which you would in turn draw to background (or you can use glDrawPixels() in case you don't require any scaling). After that, you need to have your model, complete with normals for lighting. Models can be eg. exported from Blender or 3DS Max to ascii format, which is pretty easy to parse. Then you can draw the model. Colors can be changed using glColor3f() before drawing the model (make sure you don't specify different color while drawing the model). Positioning of the models is done using matrices. The old OpenGL have some handy and easy-to-use functions for rotating and translating objects. There are also functions for scaling the objects (changing size), so that is covered pretty easy. All you need is to figure out camera position, relative to the marker (which i believe is implemented in OpenCV).
If you were to use the forward-compatible OpenGL, you would need to set up vertex buffer objects to contain model data and write vertex and fragment shaders to shade and display your model. That's kinda more work for which you get extended flexibility. But you can use shaders in the old OpenGL as well, if you decide you need them (eg. for some special effects).
Learning how to use a scenegraph or an engine (ogre) can take some time, i would not recommend it for your task.
is there anyway to build rich animation with C++?
I have been using OpenCV for object detection, and I want to show the detected object with rich animation, Is there any easy way to realize this?
I know flash can be used to easily build rich animation. But can flash be reliably integrated with C++ and How?
Also, Can OpenGL help me with this? To my knowledge, OpenGL is good for 3D rendering. But I am more interested in showing 2D animations in an image. So I am not sure whether this is a right way to go.
Another question, how are those animations in augmented reality realized? What kind of library are they using?
Thank you in advance.
Its difficult to tell if this answer will be relevant, but depending on what sort of application you are creating you may be able to use Simple DirectMedia Layer.
This is a cross-platform 2D and 3D (via OpenGL) media library for C, C++ and many other compatible languages.
It appears to me that you wish to produce an animated demo of your processing results. If I am wrong, let me know.
The simplest way to produce a demo of a vision algorithm is to dump the results to a distinct image file after each processed frame. After the processing session, these individual image files are employed to prepare the video using e.g. mencoder. I employed such procedure to prepare this.
Of course, your program can also produce OpenGL. Many people dealing with 3D reconstruction do that. However, in my opinion that would be an overkill for simple 2D detection. Producing flash would be an even greater overkill.
I am trying to develop a 3D game in openGL and i need to create many 3D objects.. I am a begginner in openGL.. I have tried with many 3D softwares like Blender , MODO, Unity 3D and Cheetah.
I am easily able to create my objects with these and exporting as Wavefront .OBJ, and converting it to a header file using a perl script. This header file is added to my openGL project..
The 3D objects are seen, but its not perfect. The script i used is to convert the .OBJ to .h using TRIANGLES.. And the object is seen with triangles. Its not full.. No way when i used TRIANGLE STRIP,FAN..? Problems with the vertices..
Is the problem with my Script or is it the wrong way i have gone..?? Or is there any other best ways to directly import 3D objects to openGL..??
The below link is the best one which you can get for 3D objects to openGL.. i got the scripts from these..
http://www.heikobehrens.net/2009/08/27/obj2opengl/
please help..
You don't want to go that way. Direct drawing mode (using TRIANGLE and friends) is extremely slow in OpenGL.
Instead, you should pick a decent format and write a loader for it (or use one found on the web). Good formats would be 3ds, obj if gzipped, collada.
Here's an example tutorial on loading from Milkshape files.
Once you load your objects programatically, you can use Vertex Arrays, or even better VBO's to display them. This is waaay faster.
Google for a mesh loader for your favorite format, or write one yourself.
I have written a reader/renderer for AC3D files that works fine on the iPhone (OpenGL ES)
Feel free to have a look at it here.
There is also an obj loader by Jeff Lamarche at google code.
AC3D can reduce the triangle count pretty good and as an alternative I ported QVis to the mac. My reader/renderer also tries to build tri-strips.
About VBO's. I have not seen any gained performance when using them in the iPhone. I'm not the only one.