Show 3D Object in specific Gui
by Playware · in Torque Game Builder · 12/11/2006 (12:20 am) · 3 replies
Hi All,
I am tring to show 3D Object in the Gui, but get there.
For this purpose, i am calling the code in Gui::onWake() like this
function AbcGui::onWake()
{
%shape = new t2dShape3D() { scenegraph = resultGuiGraph2D; };
%shape.setShape("MyProject/data/images/player.dts");
%shape.setPosition( "100 100" );
%shape.setSize( "100 100" );
}
Here I defined seprate 'resultGuiGraph2D' sceneGraph for this purpose. Is it okay ?
But it is showing nothing.
Once i saw something on this type of topic two months ago, but that was not clear what to do.
In that It is said that "You could just create a new scenegraph in your GUI and display the object in there"
but my question is how i will display the object in there.
If any help is for me, it is appreciated.
thnx a lot.
I am tring to show 3D Object in the Gui, but get there.
For this purpose, i am calling the code in Gui::onWake() like this
function AbcGui::onWake()
{
%shape = new t2dShape3D() { scenegraph = resultGuiGraph2D; };
%shape.setShape("MyProject/data/images/player.dts");
%shape.setPosition( "100 100" );
%shape.setSize( "100 100" );
}
Here I defined seprate 'resultGuiGraph2D' sceneGraph for this purpose. Is it okay ?
But it is showing nothing.
Once i saw something on this type of topic two months ago, but that was not clear what to do.
In that It is said that "You could just create a new scenegraph in your GUI and display the object in there"
but my question is how i will display the object in there.
If any help is for me, it is appreciated.
thnx a lot.
About the author
#2
If your going to debug your code, you need to learn to simplify the problem. So before you even include gui elements, can you load just a .dts by itself?
- Did you verify the path works?
- Is your dts in that folder (they usually go in the shapes folder)?
- Also, doesn't your path need the ~ symbol, for example "~/MyProject/data/images/player.dts"?
12/21/2006 (10:28 am)
I cant help with 3d in the gui, but here are some thoughtsIf your going to debug your code, you need to learn to simplify the problem. So before you even include gui elements, can you load just a .dts by itself?
- Did you verify the path works?
- Is your dts in that folder (they usually go in the shapes folder)?
- Also, doesn't your path need the ~ symbol, for example "~/MyProject/data/images/player.dts"?
#3
12/24/2006 (7:36 pm)
This is how I do a few things in my project. Just add a scenewindow to your GUI, and then give it it's own scenegraph. Make sure you position the object correctly so it displays in the window! You can probably even use the loadlevel function to load a .t2d file into your GUI scenewindow. Sorry I don't have time to write example code, but hopefully you get the idea.
Associate amaranthia