Jump to content

  • Log In with Google      Sign In   
  • Create Account


Are there any intrinsics for Vectors, Colors and matrices etc?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 lucky6969b   Members   -  Reputation: 586

Like
0Likes
Like

Posted 21 July 2013 - 04:05 AM

Thanks.............

Jack



Sponsor:

#2 lucky6969b   Members   -  Reputation: 586

Like
0Likes
Like

Posted 21 July 2013 - 04:27 AM

I find glm but the zip package is a bit strange, how do I install it?

Do I dump all hpp files to my visual C++ include directory?

Thanks

Jack



#3 Brother Bob   Moderators   -  Reputation: 8019

Like
0Likes
Like

Posted 21 July 2013 - 04:54 AM

Don't dump anything into your visual studio installation. Put all your third party libraries into a separate directory of your choice  and add include paths to the libraries in the project settings. In Visual studio 2012: Project->Properties->Configuration Properties->VC++ Directories->Include Directories.



#4 lucky6969b   Members   -  Reputation: 586

Like
0Likes
Like

Posted 21 July 2013 - 05:00 AM

How do I represent Colors in OpenGL? it seems it doesn't exist even in glm?

And seems like cal3d doesn't have inverse kinematics. Have to put every piece together.

Thanks

Jack



#5 Brother Bob   Moderators   -  Reputation: 8019

Like
0Likes
Like

Posted 21 July 2013 - 05:14 AM

A 3 och 4-component vector works just fine. After all, a color is a point in a color space.



#6 lucky6969b   Members   -  Reputation: 586

Like
0Likes
Like

Posted 21 July 2013 - 05:32 AM

common.h

#include "glm.hpp"

#define UINT unsigned int
#define DWORD unsigned long

#define glColorRGBA glm::vec4

myOpenGLWidget.h

#pragma once
#include "openglwidget.h"
#include "common.h"
#include "glm.hpp"

class myOpenGLWidget :
    public OpenGLWidget
{
public:

#ifdef QWIDGET_H
    myOpenGLWidget( QWidget *parent = 0, Qt::WFlags flags = 0 );
#else
    myOpenGLWidget();
    
#endif

    

    virtual ~myOpenGLWidget();
    
    virtual void initCamera();
    virtual void initModels();
    
    virtual void initEffects();

    //-----------------------------------------------------------------------------
    // Name: initialize()
    // Desc: This function will only be called once during the application's
    //       initialization phase. Therefore, it can't contain any resources that
    //       need to be restored every time the OpenGL device is lost or the
    //       window is resized.
    //-----------------------------------------------------------------------------
    bool initialize();
    
    //-----------------------------------------------------------------------------
    // Name: uninitialize()
    // Desc: Releases all previously initialized objects
    //-----------------------------------------------------------------------------
    void uninitialize();
    
    virtual void update();
    

    //-----------------------------------------------------------------------------
    // Name: restoreDeviceObjects()
    // Desc: You are encouraged to develop applications with a single code path to
    //       respond to device loss. This code path is likely to be similar, if not
    //       identical, to the code path taken to initialize the device at startup.
    //-----------------------------------------------------------------------------
    bool    restoreDeviceObjects();

    //-----------------------------------------------------------------------------
    // Name: invalidateDeviceObjects()
    // Desc: If the lost device can be restored, the application prepares the
    //       device by destroying all video-memory resources and any
    //       swap chains. This is typically accomplished by using the SAFE_RELEASE
    //       macro.
    //-----------------------------------------------------------------------------
    bool invalidateDeviceObjects();
    
    //-----------------------------------------------------------------------------
    // Name: render()
    // Desc: Draws the scene
    //-----------------------------------------------------------------------------
    virtual bool    render();
    
    //-----------------------------------------------------------------------------
    // Name: clearScene()
    // Desc: Clear the render target and depth stencil
    //-----------------------------------------------------------------------------
    void    clearScene(  glColorRGBA ClearColor, float Z, DWORD Stencil );
    
    //-----------------------------------------------------------------------------
    // Name: clearRenderTarget()
    // Desc: Clear the render target
    //-----------------------------------------------------------------------------
    void    clearRenderTarget( glColorRGBA ClearColor );

glColorRGBA and DWORD are not defined.

Wondering why

Thanks

Jack


Edited by lucky6969b, 21 July 2013 - 05:52 AM.


#7 Brother Bob   Moderators   -  Reputation: 8019

Like
0Likes
Like

Posted 21 July 2013 - 06:08 AM

I see no reason why that would happen in the code you have posted. And when posting errors, show the exact error message. But as an aside, there's no reason to use defines to make type aliases; use typedefs for that.


Edited by Brother Bob, 21 July 2013 - 06:08 AM.


#8 lucky6969b   Members   -  Reputation: 586

Like
0Likes
Like

Posted 21 July 2013 - 01:47 PM

Thanks!, it is working like a charm.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS