Loading a DTS model into TX3D
by Kory Imaginism · in Torque X 2D · 12/02/2007 (9:06 pm) · 4 replies
Sorry if this sounds like a stupid question but can some one send me a link on where i can find information on how to load in a DTS model into torque X3D? A playable or a non playable it doen't matter. thanks for your time
#2
John K.
12/03/2007 (8:42 am)
Here's pretty much the same thig in just plain code. For example, after the scene loads in the Game.cs file, you can add the following.TorqueObject objPlayer = new TorqueObject(); T3DTSRenderComponent componentRender = new T3DTSRenderComponent(); componentRender.ShapeName = @"data\shapes\sphere.dts"; T3DSceneComponent componentScene = new T3DSceneComponent(); componentScene.Position = new Microsoft.Xna.Framework.Vector3(1024, 1024, 300); componentScene.RenderObjectBounds = true; objPlayer.Components.AddComponent(componentRender); objPlayer.Components.AddComponent(componentScene); TorqueObjectDatabase.Instance.Register(objPlayer);
John K.
#3
12/03/2007 (9:15 am)
That seemed to work well for me John. I was testing it out myself earlier, and got the render component peice, but was missing the scene component! I also noticed it seems to work with some DTS, and not others. I am not sure why yet, i get a nodeindex error in the shapeinstance _RenderMesh function. Shows up fine in the torqueshowtoolpro though. Thanks for the code and thank you sean for the xml peice!
#4
Thank you for all of your help
12/06/2007 (9:50 am)
Starting from one of the Torque X3d start kits if you have a player code where do you implement code?Thank you for all of your help
Torque Owner Sean T. Boyette
for static DTS:
First add an object type -under the
Next add the materials that are located in your DTS - under the
Now add your actual data
Of course - this is the quickest - down and dirty and the x,y,z, pos are difficult to get - but there are work around!
Sean