Terrain Model Plugin

rated by 0 users
This post has 7 Replies | 4 Followers

Top 25 Contributor
Posts 184
SunBurn_Pro_Licensee
maconbot Posted: 04-26-2012 1:45 PM

Greetings,

I am hoping to be able to use this plugin to allow me to collide on my Terrain.  I've imported the plugin via the plugin manager to a new created SB project.  I am attempting to follow these steps:

- Save a height map texture anywhere in the project's Content folder
- Create a "*.terrain" text file alongside the texture, which contains only the texture filename
- Add the "*.terrain" file to the project's content project or import it into the SunBurn editor
- The file is loaded by the content pipeline as a standard XNA Model

I have a saved 256x256 .bmp heightmap that I have used in another sample in my content folder.  Step 2 is a little confusing, do I create a blank text doc in notepad or right click > Add and the select the .ter terrain file under SunBurn.  I have tried both, and I don't seem to know what importer setting to use on these things.  And I get the error...

Error 1 Cannot autodetect which importer to use for "SBterrain.bmp". There are no importers which handle this file type. Specify the importer that handles this file type in your project. C:\Users\Chad\Desktop\dev\SB\Day 1\TerrainPlugin\TerrainPluginContent\SBterrain.bmp TerrainPlugin

I've tried several importers but all seem to error out.  From what I gather from this plugin all I should have to do is essentially drag in my .bmp and debug, open the editor and then drop in my blank text file and suddenly a terrain will appear?

I know you have slatted for more tutorials, not sure how soon you will roll out.  You may wait until asked and then role out the tutorial, that is something I've done in the past.  As a new user I feel very lost at trying to discover all of these great features.  I am hoping not to be a tool in asking questions, however other brand new users signing up with you will probably have the same questions.

Top 25 Contributor
Posts 184
SunBurn_Pro_Licensee

any hints on terrain collision?  I haven't been able to find any samples.

Top 10 Contributor
Posts 5,368
Employee
SunBurn_Studio_Licensee

Hi maconbot,

To clarify both SunBurn's built-in terrain and the separate Terrain Mesh plugin support collision.  The big difference between the two is that the Terrain Mesh plugin is compatible with WP7.

That said they are setup very differently - check out the Custom Effect example to see how the built-in terrain is setup.

To setup a Terrain Mesh (from the plugin) create a blank text file with the extension ".terrain" and the name of the height map file in the text file.  When you add the file to your content project Visual Studio will automatically select the Terrain Mesh plugin importer for it, then set the processor to the SunBurn Model Processor.  The terrain is loaded just like other xna models.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 25 Contributor
Posts 184
SunBurn_Pro_Licensee

I checked out the Custom Effects example here:

http://www.synapsegaming.com/downloads/resource.aspx?guid=07905580-515d-44f9-81bf-7a70703ecee2

Switched on a box collider, checked receives updates and gravity and my FBX model falls through the terrain.

 

Top 25 Contributor
Posts 184
SunBurn_Pro_Licensee

I've searched the forums for the words "terrain collision" and no information about how to achieve a character not falling through a terrain can be found.  Hopefully the pictures above prove helpful.  Do I perhaps use a character controller rather than gravity?

I tried going into the code and adding:

terrain.CollisionType = SynapseGaming.LightingSystem.Collision.CollisionType.Collide;

Which strangely makes my character float up?  Please advise with a specific way to make the character {which is a FBX file) walk on terrain (which is drawn from a heightmap.) 

Top 25 Contributor
Posts 184
SunBurn_Pro_Licensee

Tried now with a Character Controller...used the Dojo sample which comes with CollisionType on.  Removed the dojo group and added a terrain, made sure to put textures on it in case that matters.

Not sure what I am missing.  Please advise.

Top 10 Contributor
Posts 1,128
SunBurn_Community_Licensee
SunBurn_Contributor

Hi maconbot,

maconbot:
Which strangely makes my character float up?

I've not used the terrain plugin yet but here's a couple of things you might want to check...

1) Have you got "affected by gravity" turned on for the character?

2) Is the initial starting point for the character intersecting the terrain?

Sorry if none of that helps.

Top 25 Contributor
Posts 184
SunBurn_Pro_Licensee

Gravity was turned on and spawn point was above.

I didn't have the terrain mesh on...this seemed to fix it:

terrain.CollisionType = SynapseGaming.LightingSystem.Collision.CollisionType.Collide;

terrain.HullType = HullType.Mesh;

...I ended up deviating from the plugin and just tried to get the normal terrain method happening.

http://www.synapsegaming.com/forums/p/3126/19076.aspx#19076

Page 1 of 1 (8 items) | RSS