Beispiel #1
0
// The equivalent to glScale applied to the model matrix
void scale(float x, float y, float z) {

	float aux[16];

	setScaleMatrix(aux,x,y,z);
	multMatrix(modelMatrix,aux);
	setModelMatrix();
}
Beispiel #2
0
    // Constructor(s) ################################################
    //################################################################
    Object3D(bool active = true,
             glm::mat4 scaleMatrix       = glm::mat4(),
             glm::mat4 translationMatrix = glm::mat4(),
             glm::mat4 rotationalMatrix_0 = glm::mat4(),
             glm::mat4 rotationalMatrix_1 = glm::mat4()) {

        setActive(active);
        setRotationMatrix_0(rotationalMatrix_0);
        setRotationMatrix_1(rotationalMatrix_1);
        setScaleMatrix(scaleMatrix);
        setTranslationMatrix(translationMatrix);

        setLastModelMatrix(getModelMatrix());
    }
Beispiel #3
0
    // Constructor(s) ################################################
    //################################################################
    Object3D(char* objName, char* fileName, UINT32 vertexCount, float modelSize, bool active = true,
             glm::mat4 scaleMatrix       = glm::mat4(),
             glm::mat4 translationMatrix = glm::mat4(),
             glm::mat4 rotationalMatrix  = glm::mat4()){

        setObjName(objName);
        setFileName(fileName);
        setVertexCount(vertexCount);
        setModelSize(modelSize);
        setActive(active);

        //Unless default function parameters are overwritten,
        //we will write identity matrices to the matrices
        setRotationMatrix(rotationalMatrix);
        setScaleMatrix(scaleMatrix);
        setTranslationMatrix(translationMatrix);

    }