[Solved] Creating 3D software C++ [closed]

You can check out this tutorial: http://www.codeproject.com/Articles/20286/GLUI-Window-Template#_articleTop or You can look at mine I did for a school project. https://github.com/sitting-duck/stuff/tree/master/School%20-%20Comp%20Sci/Computer%20Animation%20-%20Fall%202014/Assn1%20-%20Transformations/assn1%20redo/assn1 In this version I just use key bindings to initiate the transformations. Will be easier than making a GUI, so I did that first to learn how to get the transformation code all working, when … Read more

[Solved] GLSL compiles but won’t link [closed]

Many GLSL implementations don’t actually compile the shaders until you call LinkProgram. When you call CompileShader it just does a basic syntax sanity check. That’s because to get reasonable performance on most GPUs, whole program optimization is needed. Thus, you might see what one would normally consider “compile” errors only when you link. solved GLSL … Read more

[Solved] Loading .obj file using c++ and opengl [closed]

Actually there are many solutions if you search in Google. Here is one simple solution as below. First define one model containing face and vertex info: class obj3dmodel { struct vertex{ double x; double y; double z; }; struct face{ unsigned int v1,v2,v3; }; std::vector<vertex> vetexes; std::vector<face> faces; public: void readfile(const char* filename); void draw(); … Read more

[Solved] Function Pointers stored in global variables get set to 0 when entering function, and get back to previous state when exiting function

if you write in header file static PFNGLGETERRORPROC glGetError; every c/cpp have own private copy of glGetError and it not conflict with other because it static – so different cpp files use different versions of glGetError – in one cpp unit you init one version and it !=0, when you enter to another cpp unit … Read more

[Solved] Is it possible to create the low-level grapics API (similar to OpenGL)? [closed]

No, implementing something like OpenGL is not possible. Since the time OpenGL has decended from the heavens complete, writing something like it was forbidden by all common religions. But really, what you’ll actually need is about 21 years of work, a few thousands of developers and broad support from all industry leaders, so yea, piece … Read more

[Solved] rotate 5 circle problem [duplicate]

You should call glutSwapBuffers only once in the drawing function. For an animation you have to call glutPostRedisplay, to ensure that the display function will be called again. The glBegin and glEnd calls only have to be called once per circle. In the for loop you just supply vertices with calls to glVertex. To simplify … Read more

[Solved] Why is there the need for the index argument in glEnableVertexAttribArray? [duplicate]

Because it’s possible to set a vertex attribute to a value that’s constant for all elements using glVertexAttrib. Yes, you could to that to the same effect with a uniform as well, but this kind of per-attribute selection of where a value comes from (sourced from array, or set constant) has been around for ages … Read more

[Solved] PaintGL() call understanding [closed]

If you haven’t enabled vsync, frames swap as often as possible (if you haven’t added artificial pause). If you pushed high load on graphics card, it is likely that your program is GPU-limited (CPU have nothing to do and standing idle waiting for GPU to finish drawing). When your program is invisible, drawing costs close … Read more

[Solved] How to rotate a vector in opengl?

Yes OpenGL uses 4×4 uniform transform matrices internally. But the glRotate API uses 4 parameters instead of 3: glMatrixMode(GL_MODELVIEW); glRotatef(angle,x,y,z); it will rotate selected matrix around point (0,0,0) and axis [(0,0,0),(x,y,z)] by angle angle [deg]. If you need to rotate around specific point (x0,y0,z0) then you should also translate: glMatrixMode(GL_MODELVIEW); glTranslatef(+x0,+y0,+z0); glRotatef(angle,x,y,z); glTranslatef(-x0,-y0,-z0); This is … Read more

[Solved] Mesh aren’t displayed in their correct positions for a FBX model of multiple meshes

Locked. There are disputes about this answer’s content being resolved at this time. It is not currently accepting new interactions. According to the Transformations example code in Autodesk’s official SDK, a node’s global position in the world space is recursively calculated by the CalculateGlobalTransform(FbxNode* pNode) function as in the sample code below. Very important things … Read more