njord Posted May 16, 2011 Share Posted May 16, 2011 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. Quote Link to comment Share on other sites More sharing options...
njord Posted May 25, 2011 Author Share Posted May 25, 2011 up Quote Link to comment Share on other sites More sharing options...
VeTaL Posted May 25, 2011 Share Posted May 25, 2011 I think, this is question to Josh Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Flexman Posted May 25, 2011 Share Posted May 25, 2011 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. Quote 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 More sharing options...
Admin Posted May 27, 2011 Share Posted May 27, 2011 The last answer is correct. The instances get added into the vegetation data structure dynamically when a scene is loaded, and they are just stored as raw data. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.