Jump to content

Getting vegetation layer position information


njord
 Share

Recommended Posts

Hello guys. When creating a terrain in Editor, we can add trees and other vegetation either by "drag and drop" or "vegetation layer tool". Of course adding trees with "drag and drop" is so exhausting and sometimes impossible for large terrains.

 

The thing is, we use leadwerks for visualisation, "nvidia physx" as the physics engine in our simulator. So we need to create collision boxes and place them on the correct positions in the physics world manually. We implemented a simple program to create a physx mesh file (.sbx file that includes a terrain -> .obj file) from terrain heightfield so we can drive vehicles on a Leadwerks terrain. But when trees placed with the veg tool, I cannot retrieve their positions and orientations, so i cannot create and place collision meshes around. The ori and pos information are stored in the .dat files as Josh said (before the forum breakdown). But how can I read or retrieve them ? They are binary!

 

Thanks in advance.

 

PS : If you have any completely other ideas on creating collision boxes for leadwerks terrain objects, please share.

Link to comment
Share on other sites

  • 2 weeks later...

Vegetation data is a flat file format, each 64 bytes would be the 4x4 matrix from GetEntityMatrix(), place one veg item, save, and you should have a 64 byte file containing the matrix for that vegetation entity.

 

You'll have to find some way of sorting the data spatially, I'm not sure the saved veg.dat files are grouped in any particular way.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...