Game Development Community

TGEA & GuiObjectView

by Adternative · in Torque Game Engine Advanced · 10/23/2007 (8:55 am) · 5 replies

I need to have 3D objects (dts) on top of my GUI.

Currently Im trying to use the GuiObjectView resource, but I can't put it to work with TGEA 1.0.3.

My render method looks like this:

GFX->clear( GFXClearTarget | GFXClearZBuffer, ColorI(255,0,0), 1.0f, 0);
GFX->setZEnable(true);
GFX->setZWriteEnable(true);
GFX->setZFunc(GFXCmpLessEqual);
GFX->setLightingEnable(false);
GFX->setAmbientLightColor(ColorF(0.3f, 0.3f, 0.3f));

// Determine the camera position, and store off render state...
MatrixF modelview;
MatrixF mv;
Point3F cp;
modelview = GFX->getWorldMatrix();
mv = modelview;
mv.inverse();
mv.getColumn(3, &cp);
// Set up the base SceneState.
F32 left, right, top, bottom, nearPlane, farPlane;
RectI viewport;
GFX->getFrustum( &left, &right, &bottom, &top, &nearPlane, &farPlane );
viewport = GFX->getViewport();

SceneState* pBaseState = new SceneState(NULL,
0,
left, right,
bottom, top,
nearPlane,
farPlane,
viewport,
cp,
modelview,
2000,
2000,
ColorF(0.1,0.1,0.1),
0,
NULL,
1);

pBaseState->mFlipCull = false;
TSMesh::setSceneState( pBaseState );
TSMesh::setRefract(false);

for (S32 i=0; i<33; i++)
{
if (mMeshObjects.mMesh[i].mesh)
{
// Animate and render
if(mMeshObjects.mMesh[i].mode == 1)
{
S32 time = Platform::getVirtualMilliseconds();
S32 dt = time - mMeshObjects.mMesh[i].lastRenderTime;
mMeshObjects.mMesh[i].lastRenderTime = time;
F32 fdt = dt;

mMeshObjects.mMesh[i].mesh->advanceTime( fdt/1000.f, mMeshObjects.mMesh[i].thread);
mMeshObjects.mMesh[i].mesh->animate();
}

mMeshObjects.mMesh[i].mesh->render();
}
}

TSMesh::setSceneState( NULL );
delete pBaseState;

GFX->setLightingEnable(false);
GFX->setZEnable(false);
GFX->setClipRect(updateRect);


This code doesnt render anything...


I have tried all sort of combinations, but I don't understand well how TGEA renders and so Im totally lost...

Has anybody achieved this?

#1
10/23/2007 (10:10 am)
Did you see this thread?
#2
10/24/2007 (1:15 am)
Thank u, thank u very much, it's working for me now!!
#3
10/24/2007 (1:31 am)
Would you mind putting it all together in a resource?
#4
10/24/2007 (3:21 am)
OK, can do it
#5
10/24/2007 (4:16 am)
Hmm, did you see this thread too, as it also is about this issue. And, the 2 guiobjectview is allready up for grabs. Simply throw them into your project, add them in and compile -then it's working fine in TGEA!