fix typo in texels flip
add support to create a cube in TinyRenderer (quick test)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "OpenGLWindow/SimpleOpenGL3App.h"
|
||||
#include "Bullet3Common/b3Quaternion.h"
|
||||
#include "Bullet3Common/b3CommandLineArgs.h"
|
||||
#include "Bullet3Common/b3Transform.h"
|
||||
|
||||
#include "assert.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -81,8 +83,12 @@ int main(int argc, char* argv[])
|
||||
int textureWidth = gWidth;
|
||||
int textureHeight = gHeight;
|
||||
|
||||
TinyRenderObjectData renderData(textureWidth, textureHeight, "floor.obj");
|
||||
|
||||
TinyRenderObjectData renderData(textureWidth, textureHeight);//, "african_head/african_head.obj");//floor.obj");
|
||||
|
||||
//renderData.loadModel("african_head/african_head.obj");
|
||||
//renderData.loadModel("floor.obj");
|
||||
|
||||
renderData.createCube(1,1,1);
|
||||
|
||||
|
||||
myArgs.GetCmdLineArgument("mp4_file",gVideoFileName);
|
||||
@@ -127,12 +133,22 @@ int main(int argc, char* argv[])
|
||||
app->m_instancingRenderer->getActiveCamera()->getCameraProjectionMatrix(projMat);
|
||||
float viewMat[16];
|
||||
app->m_instancingRenderer->getActiveCamera()->getCameraViewMatrix(viewMat);
|
||||
B3_ATTRIBUTE_ALIGNED16(float modelMat[16]);
|
||||
|
||||
b3Transform tr;
|
||||
tr.setIdentity();
|
||||
static float posUp = 0.f;
|
||||
posUp += 0.001;
|
||||
b3Vector3 org = b3MakeVector3(0,posUp,0);
|
||||
tr.setOrigin(org);
|
||||
tr.getOpenGLMatrix(modelMat);
|
||||
|
||||
for (int i=0;i<4;i++)
|
||||
{
|
||||
for (int j=0;j<4;j++)
|
||||
{
|
||||
renderData.m_viewMatrix[i][j] = viewMat[i+4*j];
|
||||
//renderData.m_projectionMatrix[i][j] = projMat[i+4*j];
|
||||
renderData.m_modelMatrix[i][j] = modelMat[i+4*j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user