Game Development Community

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

#1
08/17/2006 (11:27 am)
If you place your .dts object in your "shapes" folder in your project it then should show up in the Level Builder 3D Shapes panel.
#2
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...