Jump to content

  • Log In with Google      Sign In   
  • Create Account


Chris528

Member Since 25 Aug 2007
Offline Last Active Nov 24 2013 01:50 PM

Posts I've Made

In Topic: Problem with md5 viewer

26 October 2013 - 05:35 PM

Just in case if you didn't notice, there is glm::slerp in the newer versions. The older versions of glm probably used mix as slerp.

Thanks, I did notice that there is glm::slerp, I just hadn't really tried it as there was a problem having to do with there being two versions of glm::slerp having the same arguments, one defined in quaternion.hpp and another in compatibility.hpp. I fixed it by making a small hack to compatibility.hpp. (added an additional namespace inside of glm). After getting that out of the way, the program compiled and everything worked. Thanks for your help, I appreciate it.


In Topic: Problem with md5 viewer

26 October 2013 - 11:21 AM

I figured out the issue, I tried out an earlier version of glm and it worked. It appears that glm::mix is implemented in a different manner than newer versions of glm.


In Topic: Problem with md5 viewer

26 October 2013 - 10:17 AM

Just a guess, I think your quaternion interpolation is broken. Maybe try disabling it and see if everything else works correctly?

Yeah, it has to do with the interpolation of the joint orientations. One thing i tried is glm::mix( joint0.m_Orient, joint0.m_Orient, fInterpolate ); That stopped the glitching but causes twitching as it isn't really being interpolated anymore.  It appears that there is something wrong with the way glm::mix is handling things. I even checked the value of  fInterpolate and that seems to be working correctly. Here's the current code.

finalJoint.m_Orient = glm::mix( joint0.m_Orient, joint1.m_Orient, fInterpolate );

In Topic: lwjgl VBO´s

25 October 2013 - 04:43 AM



Hi everyone,

 I need help. I use VBO for loading object. When it´s loading one object, it´s all right. But when I want loading more object it´s a problem. The first object is rendering well but second object is rendering as first. Could you tell me how rendering multiple objects ? How update VBO?

Why not create a simple mesh class with its own vbo and render function?. That way you could create multiple instances of the class using different geometry and put them in a std::vector. When it comes to rendering, just create a loop that goes through the std::vector and calls the render functions.

void init()
{
    ...
    meshes.push_back(new mesh("triangleList1.txt"));
    meshes.push_back(new mesh("triangleList2.txt"));
    meshes.push_back(new mesh("triangleList3.txt"));
    ...
}

void Render(...)
{
    ...
    for (int i = 0; i < meshes.size(); i++)
    {
        meshes[i]->render();
    }
    ...
}

In Topic: Problem with Key presses in SDL 2.0

14 October 2013 - 04:31 PM

I cant view your code from my work ( internet restricted here ).

 

Well.. you can try a following approach:

 

1 - When you first detect the KEY_DOWN event, toggle a boolean variable to 'true'...

2 - When you detect the event of KEY_UP toggle the boolean to false....

 

something like it:

boolean isActive = false;
 while (!quit){ 
                while (SDL_PollEvent (&eventQueue)) { 
             
           if (eventQueue.type == SDL_QUIT) {
              quit = true; 
           } else if (eventQueue.type = SDL_KEYDOWN){ 
               switch (eventQueue.key.keysym.sym){ 
                        case SDLK_3:
                              if( !isActive ) {
                                isActive = true 
                                activate_culling();
                              }
                          break; 
               } 
           } else if (eventQueue.type = SDL_KEYUP){ 
               switch (eventQueue.key.keysym.sym){ 
                        case SDLK_3: 
                           if( isActive ) {
                              isActive = false;
                              deactivate_culling();
                           }
                         break; 

               } 
           } 
 } 

This way you will call your activate_culling() function the first time the key_down event is registered and will deactivate it when the key_3 is released...

 

Can you figure it out?

 

[]´s

The problem is that i have my input extracted into a class and the code is shared with multiple projects. Which means i shouldn't add project specific stuff to it. I need to somehow extend my input class.


PARTNERS