How to Load 3D object in 2D
by Stanley D Chatman · in Torque Game Builder · 08/17/2006 (1:31 am) · 3 replies
I have read thru the tutorial on doing this and am having trouble getting this to work. I have created a function called loadShape and it is in my game.cs file.
function loadShape()
{
%shape = new t2dShape3D() { scenegraph = t2dScene; };
%shape.setShape("~/models/reinstatedsoldier.dts");
%shape.setPosition( "20 10" );
%shape.setSize( 15 );
// Set Shape Skin.
//%shape.setSkin( "reinstatedsoldier", "reinstatedsoldier" );
echo("Stan");
}
I call this function from the startGame function but nothing is ever loaded. I checked the console and at first it said I was pointing to the wrong folder for my skin but I got that resolved. What am I missing here?
Thanks in advance,
Stanley D. Chatman
function loadShape()
{
%shape = new t2dShape3D() { scenegraph = t2dScene; };
%shape.setShape("~/models/reinstatedsoldier.dts");
%shape.setPosition( "20 10" );
%shape.setSize( 15 );
// Set Shape Skin.
//%shape.setSkin( "reinstatedsoldier", "reinstatedsoldier" );
echo("Stan");
}
I call this function from the startGame function but nothing is ever loaded. I checked the console and at first it said I was pointing to the wrong folder for my skin but I got that resolved. What am I missing here?
Thanks in advance,
Stanley D. Chatman
#2
change
to this
08/17/2006 (11:28 am)
Try checking out the 3D shapes tutorial in the latest release of TGB... The one on TDN is a little dated.change
%shape = new t2dShape3D() { scenegraph = t2dScene; };to this
%shape = new t2dShape3D() { scenegraph = SceneWindow2D.getScenegraph(); };
#3
08/17/2006 (4:02 pm)
It worked like a charm. Thanks so much...
Torque 3D Owner Matthew Langley
Torque