• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# OpenGL 3D Models Animation and OpenGL

## Recommended Posts

Hello All! What software packages (if any) do you guys use to design and animate your 3-D objects to be imported to OpenGL? Also, how do you import them in - using someone else''s libs, your own hacked library, 3rd party product(s)? I am relatively new to OpenGL and am currently using MilkShape 3D, which I think is a pretty good modeller, although not nearly as powerfull as 3DSM (a lot cheaper though! Following the creation of the model and its joints and animation, I use the code for importing the model into OpenGL that I got from nehe.gamedev.net. The importing code is not complete, as it does not address the models'' textures, joints and animation. I am in the process of completing it. I am just curious as to what everyone else is using for animation in OpenGL. Let''s face it. It is pretty hard to do interpolation in OpenGL and I would much rather have a 3D package that can do it for me, so that all I have to do is import the model into my scene, recalculate my vertices and I''m done. Let me know what you guys are using and how that particular solution is working out for ya. Also what are its strengths and limitation? Thanks for reading and Cheers.

##### Share on other sites
I would like to know too. 3d studio max is one I heard people use. Thats another program you have to learn. And I don''t really know how to incorporate the models into opengl/Visual C++

##### Share on other sites
a version of 3dmax + maya can be downloaded for free, maya is the more powerful of the 2 (esp for character animation). there
are plugins that come supplyed (u can also write your own, which i have done in the past (very easy) that will export files)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

##### Share on other sites
I wish Zed would have elaborated a little more. Exporting files from 3DS, Maya, MilkShape, etc. is all good if you are interested in opening those files in other 3D software. We are interested in importing those models in OpenGL. For instamce, I have seen 3DS importing libs, written in C++, which can load 3DS objects, but only meshes and only the raw objects, i.e. not materials, no bones, no animation, etc...
Even nehe''s importing package for MilkShape is not complete and the other one that I came across crashes consistently
So does anyone have/know of/or is in the process of making an importing package (be it 3DS or MS3D, or Maya) that will actually import, texture map, and animate imported objects?

Cheers.

##### Share on other sites
unlike texture image formats with 3d formats everyone wants something else ie u cant have one format that please eveyone
eg do u want colour data in the 3dfile? do u want to interpolate vertices or use bones?, do u want tangent matrices etc.
.by exporting i mean exporting into a format that your program uses, most ppl make up there own 3d format eg mine is called .VeNT (i started it in 1998 ) which is a ascii text format eg heres a part of a file.

MESH
{
MESH_NAME: bollux
MESH_CONTAINS_NORMALS: NO
MESH_CONTAINS_COLOURS: NO
MESH_CONTAINS_THIS_NUM_DIFFERENT_TEXTURECOORDS: 1
NUM_VERTS: 96
NUM_TRIS: 96
NUM_TRI_GROUPS: 1
TRI_GROUP:
{
TRI_GROUP_TYPE: GL_TRIANGLES
NUM_INDICES: 288
INDICES: 1 2 0 2 3 50 3 4 51 4 5 52 5 6 53 6 7 54 7 8 55 8 9 56 9 10 57 10 11 58 11 12 59 12 13 60 13 14 61 14 15 62 15 16 63 16 1 64 17 18 1 18 2 1 18 19 2 19 3 2 19 20 3 20 4 3 20 21 4 21 5 4 21 22 5 22 6 5 22 23 6 23 7 6 23 24 7 24 8 7 24 25 8 25 9 8 25 26 9 26 10 9 26 27 10 27 11 10 27 28 11 28 12 11 28 29 12 29 13 12 29 30 13 30 14 13 30 31 14 31 15 14 31 32 15 32 16 15 32 17 16 17 1 16 33 34 65 34 66 65 34 35 66 35 67 66 35 36 67 36 68 67 36 37 68 37 69 68 37 38 69 38 70 69 38 39 70 39 71 70 39 40 71 40 72 71 40 41 72 41 73 72 41 42 73 42 74 73 42 43 74 43 75 74 43 44 75 44 76 75 44 45 76 45 77 76 45 46 77 46 78 77 46 47 78 47 79 78 47 48 79 48 80 79 48 33 80 33 65 80 49 34 33 81 35 34 82 36 35 83 37 36 84 38 37 85 39 38 86 40 39 87 41 40 88 42 41 89 43 42 90 44 43 91 45 44 92 46 45 93 47 46 94 48 47 95 33 48
}
TEXTURE_COORDS:
0.500833 0.500000
0.750417 0.500000
0.731355 0.404170
0.677071 0.322929
0.595830 0.268645
0.500000 0.249583

anyway what ive done (may prove useful) ive written a program that will input a number of various 3d files eg md2/3, quake bsp, 3ds etc + converts them into VeNT files
Q/ why convert?
A/ its easiest to deal with one file format

http://uk.geocities.com/sloppyturds/gotterdammerung.html

• ### Forum Statistics

• Total Topics
627757
• Total Posts
2978950
• ### Similar Content

• Hello! As an exercise for delving into modern OpenGL, I'm creating a simple .obj renderer. I want to support things like varying degrees of specularity, geometry opacity, things like that, on a per-material basis. Different materials can also have different textures. Basic .obj necessities. I've done this in old school OpenGL, but modern OpenGL has its own thing going on, and I'd like to conform as closely to the standards as possible so as to keep the program running correctly, and I'm hoping to avoid picking up bad habits this early on.
Reading around on the OpenGL Wiki, one tip in particular really stands out to me on this page:
For something like a renderer for .obj files, this sort of thing seems almost ideal, but according to the wiki, it's a bad idea. Interesting to note!
So, here's what the plan is so far as far as loading goes:
Set up a type for materials so that materials can be created and destroyed. They will contain things like diffuse color, diffuse texture, geometry opacity, and so on, for each material in the .mtl file. Since .obj files are conveniently split up by material, I can load different groups of vertices/normals/UVs and triangles into different blocks of data for different models. When it comes to the rendering, I get a bit lost. I can either:
Between drawing triangle groups, call glUseProgram to use a different shader for that particular geometry (so a unique shader just for the material that is shared by this triangle group). or
Between drawing triangle groups, call glUniform a few times to adjust different parameters within the "master shader", such as specularity, diffuse color, and geometry opacity. In both cases, I still have to call glBindTexture between drawing triangle groups in order to bind the diffuse texture used by the material, so there doesn't seem to be a way around having the CPU do *something* during the rendering process instead of letting the GPU do everything all at once.
The second option here seems less cluttered, however. There are less shaders to keep up with while one "master shader" handles it all. I don't have to duplicate any code or compile multiple shaders. Arguably, I could always have the shader program for each material be embedded in the material itself, and be auto-generated upon loading the material from the .mtl file. But this still leads to constantly calling glUseProgram, much more than is probably necessary in order to properly render the .obj. There seem to be a number of differing opinions on if it's okay to use hundreds of shaders or if it's best to just use tens of shaders.
So, ultimately, what is the "right" way to do this? Does using a "master shader" (or a few variants of one) bog down the system compared to using hundreds of shader programs each dedicated to their own corresponding materials? Keeping in mind that the "master shaders" would have to track these additional uniforms and potentially have numerous branches of ifs, it may be possible that the ifs will lead to additional and unnecessary processing. But would that more expensive than constantly calling glUseProgram to switch shaders, or storing the shaders to begin with?
With all these angles to consider, it's difficult to come to a conclusion. Both possible methods work, and both seem rather convenient for their own reasons, but which is the most performant? Please help this beginner/dummy understand. Thank you!

• I want to make professional java 3d game with server program and database,packet handling for multiplayer and client-server communicating,maps rendering,models,and stuffs Which aspect of java can I learn and where can I learn java Lwjgl OpenGL rendering Like minecraft and world of tanks

• A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

-What I'm using:
C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.
-Questions
Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.

• 11
• 10
• 10
• 23
• 14