Has anyone tried John"s terrain example?
by Henry Shilling · in Torque X 3D · 06/04/2009 (4:25 pm) · 33 replies
I Tried Johns Terrain example, http://www.garagegames.com/community/blogs/view/17277 , and it would not compile for me. It hangs on the line:
The TerrainDetailMaterial is defined in the xml level file, however I really do not understand enough to debug what the issue is. And then on top of that how do I bring in the really cool texture that was created with L3DT.
terrainData.DetailMaterial = "TerrainDetailMaterial";
The TerrainDetailMaterial is defined in the xml level file, however I really do not understand enough to debug what the issue is. And then on top of that how do I bring in the really cool texture that was created with L3DT.
About the author
http://twitter.com/theBigDaddio
#22
04/19/2010 (9:38 am)
this is my character creation code. It was using a boxshape, but i tried creating the shape and attaching it. here is my player code//find the physics resolver
RigidCollisionManager rigidManager = TorqueObjectDatabase.Instance.FindObject<RigidCollisionManager>("RigidManager");
TorqueObject objPlayer = new TorqueObject();
objPlayer.Name = "PlayerObject";
//give the player a presence in the scene
T3DSceneComponent componentScene = new T3DSceneComponent();
componentScene.Position = new Vector3(1024, 1036, 300);
componentScene.SceneGroup = "PlayerObject";
objPlayer.Components.AddComponent(componentScene);
//give the player a shape
T3DTSRenderComponent componentRender = new T3DTSRenderComponent();
componentRender.ShapeName = @"data\shapes\boombot\orange_player.dts";
componentRender.SceneGroupName = "PlayerObject";
objPlayer.Components.AddComponent(componentRender);
//create a collisionsphere
CollisionSphereShape sphereshape = new CollisionSphereShape();
sphereshape.Radius = .65f;
sphereshape.Center = new Vector3(0, 0, 0);
//give the player some physics attributes, lie gravity and collision
T3DRigidComponent componentPhysics = new T3DRigidComponent();
componentPhysics.SceneGroupName = "PlayerObject";
componentPhysics.GravityScale = 10.5f;
componentPhysics.Mass = 100.0f;
componentPhysics.RigidManager = rigidManager;
componentPhysics.CollisionBody.AddCollisionShape(sphereshape);
objPlayer.Components.AddComponent(componentPhysics);
//add the animation component
T3DAnimationComponent componentAnimation = new T3DAnimationComponent();
componentAnimation.SceneGroupName = "PlayerObject";
objPlayer.Components.AddComponent(componentAnimation);
//add the player movement component
MovementComponent3D componentMovement = new MovementComponent3D();
componentMovement.SceneGroupName = "PlayerObject";
objPlayer.Components.AddComponent(componentMovement);
//add a simple shadow component
T3DBlobShadowCasterComponent componentShadow = new T3DBlobShadowCasterComponent();
componentShadow.SceneGroupName = "PlayerObject";
objPlayer.Components.AddComponent(componentShadow);
//register the player object
TorqueObjectDatabase.Instance.Register(objPlayer);
#23
What I did before was not use RAW terrain, I grabbed an old version of the TGEA and made my terrain that way. Just replacing the default terrain with my new one. That was unsatisfactory as well as I got the quicksand effect.
So we either forge ahead trying to figure this out, or we wait for the new release that was supposed to be in Jan, then a few weeks ago, and now when?
EDIT: OK there is no CollisionXTerrainShape attached to the terrain, however I do not know how to create one from the terrain.
04/19/2010 (2:01 pm)
Now that I look at the thing again, yea objects fall right through. I don't recall anyone figuring out why. However I was starting a 3D project and am looking at it. What I did before was not use RAW terrain, I grabbed an old version of the TGEA and made my terrain that way. Just replacing the default terrain with my new one. That was unsatisfactory as well as I got the quicksand effect.
So we either forge ahead trying to figure this out, or we wait for the new release that was supposed to be in Jan, then a few weeks ago, and now when?
EDIT: OK there is no CollisionXTerrainShape attached to the terrain, however I do not know how to create one from the terrain.
#24
The issue with RAW or I would imagine anything but TGE terrain is going to be creating the collision mesh. I do not see how to create a collision mesh from a mesh. I think that a good place to start would be _CreateCollisionMesh in the T3DStaticGeometryComponent, taken from this thread: www.torquepowered.com/community/forums/viewthread/105761
04/19/2010 (2:55 pm)
CollisionXTerrainShape only works with a Torque Terrain, and not the latest t3d terrains it has to be TGE 1.8 or such. There is a post around here where John posted a link to a TGE compiled file to create terrains. The issue with RAW or I would imagine anything but TGE terrain is going to be creating the collision mesh. I do not see how to create a collision mesh from a mesh. I think that a good place to start would be _CreateCollisionMesh in the T3DStaticGeometryComponent, taken from this thread: www.torquepowered.com/community/forums/viewthread/105761
#25
It says it requires terrain v4 the tge creates terrain v3
I tried it with 1.8 of tgea, so it has to be older than that build
UPDATE: I tried version 1.7 and TGE 1.5.2
Version 1.7 uses V.5 terrains as does version 1.8+
TGE terrains in 1.5.2 halt the engine with an exit code 7
04/19/2010 (8:17 pm)
The latest build doesn't support the tge compiled file.It says it requires terrain v4 the tge creates terrain v3
I tried it with 1.8 of tgea, so it has to be older than that build
UPDATE: I tried version 1.7 and TGE 1.5.2
Version 1.7 uses V.5 terrains as does version 1.8+
TGE terrains in 1.5.2 halt the engine with an exit code 7
#26
Here are my steps.
1: Create terrain in 1.5.2 save mission etc.
2: rename .ter file terrain.ter and move to game/data/terrains replacing the default terrain. Also copy any textures and add them to game project in VS.
3: it runs.
I would imagine you could also go into your levelData.txscene and change the names if you were using a different name for terrain like, mountains.ter
04/20/2010 (9:49 am)
I opened the Torque thing I have been using to create terrains. 1.5.2Here are my steps.
1: Create terrain in 1.5.2 save mission etc.
2: rename .ter file terrain.ter and move to game/data/terrains replacing the default terrain. Also copy any textures and add them to game project in VS.
3: it runs.
I would imagine you could also go into your levelData.txscene and change the names if you were using a different name for terrain like, mountains.ter
#27
I wonder how they got their demo texture to look so good. Assuming it was made using tge, they must have done something to do it.
04/20/2010 (10:07 am)
it worked that time, not sure why. Anyway, my game will be mostly interior, so i just wanted something that will have a flat base. But, it would still be nice if they were to fix the raw terrain format for the next version of the upgrade or at least kick it up to V5 at least.I wonder how they got their demo texture to look so good. Assuming it was made using tge, they must have done something to do it.
#28
04/20/2010 (11:02 am)
If we could use the V5 terrain format we could export terrains in V5 format from L3DT. I was really PO'd when I tried that one and found they were V5. I really wonder what the differences are, I am certain it's probably above me to fix it.
#29
I have 5+ years of modeling experience in blender and recently started in 3DS max last month.
04/21/2010 (5:49 am)
its probably in the next upgrade cycle. I noticed that they pulled torquex off the CC partner's page. Oh, and if you need any models made, I'm more than willing to help you with that. I have 5+ years of modeling experience in blender and recently started in 3DS max last month.
#30
07/02/2010 (3:36 pm)
Off topic but, can you convert 3D models to DTS format for Torque X?
#31
07/02/2010 (5:26 pm)
What format are the 3D models in? I make DTS models it seems like every day now. Almost every 3D package has a DTS exporter, look at the TDN, tdn.garagegames.com/wiki/DTS
#32
Anybody resolve this problem?
07/05/2010 (6:33 pm)
Back on topic, I tried generating the terrain using code but still my 3D models fall through the ground.Anybody resolve this problem?
#33
However if you are using L3DT to generate the terrain you can download T3D, and export your terrain to T3D, then save it and use it as a terrain file the same way the desert terrain is currently being created.
07/05/2010 (10:16 pm)
IF you look through the code there is no collision on the terrain. It seems like the only collision they have at the moment is generated by the xterrain. Look in GarageGames.Torque.T3D.RigidCollision there is a class called CollisionXTerrainShape. I don't have any idea how you would go about adding a collsion shape to a raw terrain.However if you are using L3DT to generate the terrain you can download T3D, and export your terrain to T3D, then save it and use it as a terrain file the same way the desert terrain is currently being created.
Torque 3D Owner Henry Shilling
Smokin Skull