way to have 3d animated/rigged character in Opengl - opengl

If I want a 3D animated/rigged character in OpenGL game how i would have it in OpenGL?If i make a animated/rigged character in 3Ds max is it possible to have that character in OpenGl?would be helpful if someone gives a proper way or a tutorial link to export animated model from 3d software to open GL

OpenGL is a very simple 3D framework which only offers the bare bones. OpenGL can display triangles and fill them with color and that's about it. It comes with some helper functions to manipulate point clouds but it's really very basic.
Animation and rigging are way beyond what it can do. What you need is a framework which supports animation and rigging which then uses OpenGL to display the result.
Since you don't specify any requirements, it's hard to say which one would be good for you. Blender is probably a good place to start. It's game engine runs on many platforms, supports OpenGL, animation and rigging.

Related

SDL is pure opengl or not? if it is what are the differences?

I my collage i have to do a assignment in opengl and they intimidate us to do that in pure opengl. What it is just simply create and shown a transparent cube and put table inside it all of the model must create by the program they can't import by other modeling software like blender, 3dmax etc. And also they expect very high level lighting atmosphere in that cube. I am new to side and i heard that SDL is a game engine.
I wonder if i use SDL in my assignment may i end up with zero mark if it is not contain opengl? If there is good way to do this simple task please let me know!
Well, SDL is not a game engine and it is not pure OpenGL. However, you can build pure OpenGL applications using the windowing API that SDL gives you. SDL is just one of many options for window management and GL context creation.
SDL can set up a window for you, can set up the OpenGL context, and handle user input. From there, you can write pure OpenGL and render your cube or whatever. If you have not used OpenGL or SDL before, then you probably have a lot of work ahead of you.
As another difference, SDL does have an additional 2D rendering API. If your assignment is to do 3D with OpenGL, then obviously DO NOT use this 2D API.

deformation of SVG file. Bezier Curves?

I have an SVG file.This file shows the outline of cartoon character(2D character).
My question is, can I make a program that It allows the user to interact with the outline and deform it.
An example is, to pull the outline of character's arm, with the mouse,and the arm gets bigger.
I suppose that Bezier Curves and Elliptical Arcs is a solution.I also wonder if i use OPENGL, I might be more flexible to do that.
The interaction aspect you'll need to deal with yourself. There is a recent OpenGL extension, NV_path_rendering which makes accurate, hardware-accelerated rendering of SVG and other vector formats pretty simple. The SDK includes at least one example where interaction with control points is shown, which might make a good starting place for you. Obviously, this would require you/the end user to have a GPU which supports the extension. Here's a video of the developer explaining the extension and what it can do.
I also wonder if i use OPENGL, I might be more flexible to do that.
OpenGL will not make things easier in any way. OpenGL is a drawing API, not some kind of magic scene and geometry manager. All it gives you are points, lines and triangles and methods to define how those are to be drawn to a framebuffer.
Interaction with the user lies completely outside the scope of OpenGL.
iscriptdesign allows you to create interactive graphics, but you need to program/script those yourself.

3D model manipulation for a Desktop Augmented Reality application

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.

curves representable in OpenGL

I am a beginner in CAD development & want to know some things about OpenGL.
My main objective is to represent conics, cycloid, epicycloid, hypocycloid, involutes, etc
Can i directly represent them using some trigonometry, or do i need to convert these curves into B-Spline?
Actually i am currently developing the kernel & want to develop the kernel so that i cant display the above mentioned curves.(there is no use in supporting these curves in kernel if i cant graphically represent them!)
I dont know much about OpenGL, so please pardon me if my question is really stupid!
I tried searching over here but could not find anything useful.
OpenGL can directly render Bezier curves and surfaces using evaluators and even NURBS using the GLU API. See the OpenGL Programming Guide for more information. So you could transform those curves and surfaces into this form.
But I highly recommend you not to use these features, as they are deprecated (dropped from the core of newer OpenGL versions) and nowadays likely to be implemented in software and not in hardware.
Instead you should rather implement your own evaluation routines for such curves and surfaces, that evaluate the corresponding equations at a specified sampling rate and generate a simple vertex array (and maybe and index array). This way you stay future-ready as these can be rendered as standard line strips or triangular meshes using VBOs (the only way to render something in modern OpenGL).
And you even stay API agnostic, as a general vertex array can also be rendered using Direct3D or whatever. So this way you don't pollute your CAD kernel with draw calls. All it needs is a function to transform parametric curves and surfaces into arrays of vertices (and maybe indices) and the client/user of the kernel is responsible for drawing these with whatever API he likes.
If I am not wrong, OpenGL only works with flat polygons. Even though, you can check if the GLUT libraries have any method to draw the aforementioned figures, or google for a .obj of those figures, and scale, rotate and translate them to the desired position.

Idea about how to model a building using OpenGL/GLUT?

I'm new to graphics, and I have to make a model of a building for an assignment using only GLUT or OpenGL.
Basically the school building's model( only the exterior portion) is to be made, and I have no clue where to start. Upto now I have drawn polygons, other shapes using GLUT, nothing in which there are multiple shapes. All the drawing upto now is using lines, or points, or polygons and mathematics.
Could you please give me an idea of how to go about it?
Update: I just want to know what steps I can follow to get it done. Some reference links would be awesome!
You could use modeling programs to create your model, and then use tools such as COLLADA to get your model into OpenGL.
The problem with hand-coding a complex object like that is that it takes a great number of lines of code just to define the vertices of the object.
People usually use 3D modeler software to build complex 3D objects, like Maya, 3DSMax or Blender and then export them in a format to be read into your OpenGL application.
Think about what you want your building to look like, and think about what kind of triangles you need to render in order to make that. You can either draw the entire thing in some sort of modelling software, and then import it into OpenGL, or you can come up with the triangles/textures yourself and do it by hand in OpenGL.
The exterior of the building will probably have a similar texture on the whole thing (brick, etc), and then there will be windows, doors, and a roof. Maybe some sort of sign that says "School Building". Take this all into account, what exactly you want your building to look like, and then think about what textures you will need to draw these things.
For example, say you're doing a brick building that is in the shape of a box, with a door and a few windows. I'd use one texture for the brick, and first draw an entire wall of brick. Then, I'd use a grey/blue looking texture for the window, and draw it over the brick wall. Then I'd do the same (different texture) for the door.
Just think about the design, and then just try things out - experiment. Good luck!
I once had a simillar homework. I did it by creating the models with Google SketchUp, then export the models to .3ds file and use my program to render it.
I choose Google SketchUp because it's the easiest to use among those tool I tried. Plus, they had a discount for students. You could also use Blender, which is free but take too much time to learn IMHO. 3dsMax is too expensive to pay for a homework.
To load the model into my program, I used Assimp library.