About Store Forum Documentation Contact



Post Reply 
Importing Woody3D Tree Models
Author Message
Rabishan Offline
Member

Post: #1
Importing Woody3D Tree Models
i've found this tree generating engine called 'woody 3d'. can i integrate esenthel with this engine.
04-28-2011 06:29 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #2
RE: integration with other engines
Isn't there a option to export the trees to a Wavefront .obj file inside Woody3D? And then import it back to EE?

There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 04-28-2011 04:06 PM by Dynad.)
04-28-2011 04:06 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Rabishan Offline
Member

Post: #3
RE: integration with other engines
no they export as .wdmesh
04-29-2011 05:59 AM
Find all posts by this user Quote this message in a reply
davidvp Offline
Member

Post: #4
RE: integration with other engines
(04-29-2011 05:59 AM)Rabishan Wrote:  no they export as .wdmesh

Is there a paid version, many "tree tools" give a free version that only exports in there format, what isn't a export btw, it's just a save.

You should check there isn't something like a Export option, becouse the tree editor is useless without it, so they wouldn't just let you export in 1 format



ohhh btw I found this litle thing with text >.< don't have time 2 read it,
but could be intresting so I must get my sigarets now, cya:


"C++ Compiler
Woody3D requires an installed C++ compiler to compile the Woody3D API source code into your C++ application.
The Woody3D C++ source code is compatible with Microsoft Visual Studio 2005 / 2008 / 2010 and Apple Xcode."
(This post was last modified: 04-29-2011 10:31 AM by davidvp.)
04-29-2011 10:25 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #5
RE: integration with other engines
(04-29-2011 10:25 AM)davidvp Wrote:  Is there a paid version, many "tree tools" give a free version that only exports in there format, what isn't a export btw, it's just a save.

You should check there isn't something like a Export option, becouse the tree editor is useless without it, so they wouldn't just let you export in 1 format



ohhh btw I found this litle thing with text >.< don't have time 2 read it,
but could be intresting so I must get my sigarets now, cya:


"C++ Compiler
Woody3D requires an installed C++ compiler to compile the Woody3D API source code into your C++ application.
The Woody3D C++ source code is compatible with Microsoft Visual Studio 2005 / 2008 / 2010 and Apple Xcode."

Hi guys and on behalf of Rabishan, we would like to thank you for your replies.

Rabishan is our team mate and perhaps he didnt explain much (so sorry, as English is not our first language). Permit me to explain about Woody3D. We purchased the Woody3D because the trees made with it is low poly and it looked really good (although it is Semi realistic) but the tree looked quite natural. Unfortunately to use Woody3D trees mesh we would have to either:

1. Convert the Woody mesh files to a file format using C++
or
2. Modify the engine to load the Woody mesh file format

Unfortunately the 2nd option really isn't an option for us as we couldn't afford to purchase Esenthel Engine Source Code to add the Woody mesh file format into the object importer function. This leaves us with one last option if we still opt to go with Woody3D, which is convert the Woody mesh files into a file format using C++.

Good people and community of Esenthel, could you advice us how can we do this?

P/S: I think the structure and style for Woody3D is similar with SpeedTree. Has anyone successfuly intregrated Speedtree object into Esenthel before (without exporting to obj/fbx format)? If yes, the trick might help us as well.
04-30-2011 05:48 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: integration with other engines
did you try asking for help on woody3d support on how to convert their models?
you don't need full EE sources, you can write simple function:
bool loadwoody3d(Mesh &mesh, Str file_name){}
of course if you know the format of woody3d or have access to its raw data (vtxs/faces)

I'll make a tutorial for manual creation of mesh through code from custom vtx/face

will be in next SDK:
Code:
/******************************************************************************/
#include "stdafx.h"
/******************************************************************************/
Mesh mesh;
/******************************************************************************/
void InitPre()
{
   App.name("Dynamic Mesh");
   App.flag=APP_MS_EXCLUSIVE|APP_FULL_TOGGLE;
   DataPath("../data");
   Paks.add("engine.pak");

   D.mode(800,600).sync(true);
   Cam.dist=3;
}
/******************************************************************************/
Bool Init()
{
   MeshPart &part=mesh.parts.New(); // create a new part
   MeshBase &base=part.base; // access software version
   base.create(3, 0, 1, 0, VTX_TEX0); // create part with 3 vertexes, 1 triangle, and texture coordinates
   base.vtx.pos (0).set(-1, 1,0); // set #0 vertex position
   base.vtx.pos (1).set( 1, 1,0); // set #1 vertex position
   base.vtx.pos (2).set( 0,-1,0); // set #2 vertex position
   base.vtx.tex0(0).set(-1, 1  ); // set #0 vertex texture coordinates
   base.vtx.tex0(1).set( 1, 1  ); // set #1 vertex texture coordinates
   base.vtx.tex0(2).set( 0,-1  ); // set #2 vertex texture coordinates
   base.tri.ind (0).set( 0, 1,2); // set triangle vertex indexes (#0 #1 #2 vertexes)
   base.setNormals(); // set automatic vertex normals

   mesh.setMaterial  (Materials.ptrRequire("mtrl/brick/0.mtrl")); // set material for all parts
   mesh.setAutoTanBin(); // calculate tangents and binormals if needed
   mesh.setRender    (); // set rendering versions from software versions
   mesh.setBox       (); // recalculate bounding box from vertexes
   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   CamHandle(0.01f,10,CAMH_ZOOM|(Ms.b(1) ? CAMH_MOVE : CAMH_ROT));
   return true;
}
/******************************************************************************/
void Render()
{
   switch(Renderer())
   {
      case RM_PREPARE:
      {
         mesh.draw(MatrixIdentity);
         LightDir(Cam.matrix.z).add();
      }break;
   }
}
/******************************************************************************/
void Draw()
{
   Renderer(Render);
}
/******************************************************************************/
04-30-2011 09:03 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #7
RE: Importing Woody3D Tree Models
Hi Esenthel,

Yes we did ask them for help. But they also don't know how to help. Maybe I was not asking the right question. But from your reply I think I could ask them about it and see what they say.

Thanks for the reply and for your suggestion solutions. We will try it out asap and see what happened.
05-01-2011 08:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #8
RE: Importing Woody3D Tree Models
Esenthel,

Please forgive me if what I about to ask sound stupid, but there something I don't get. If we doing the coding based on ur suggestion, then how do we call the Woody3D Mesh object from the editor itself so that we could insert it the terrain?

The following is the the woody binary format:

Code:
WOODY3D BINARY MESH FILE FORMAT
VERSION 1.1.4


VARIABLE KEY

bl   = unsigned int (wd_bool)
r32  = float (wd_real_32)
s32  = int (wd_sint_32)
u32  = unsigned int (wd_uint_32)
s16  = short (wd_sint_16)
u16  = unsigned short (wd_uint_16)
sc8  = char
uc8  = unsigned char


BEGIN FILE FORMAT

     u32 File ID // 1125021932
      
     <Header>
          u32 version[0] // 1
          u32 version[1] // 1
          u32 version[2] // 4          
          uc8 trunk count
          uc8 branch level count
          u32 s branch count
          u32 i branch count
          u32 leaf count
          u32 s branch index count
          u32 s branch vertex count
          u32 i branch index count
          u32 i branch vertex count
          u32 leaf index count
          u32 leaf vertex count
          u32 branch lod level count
          u32 leaf lod level count
          r32 leaf lod scale per level
          r32 branch oscillation speed
          r32 leaf oscillation speed
          r32 leaf animation speed
          r32 center of leaves.x
          r32 center of leaves.y
          r32 center of leaves.z          
          bl  is texture space origin TL
          bl  is texture space origin BL
          bl  is texture space origin TR          
          bl  is texture space origin BR
          
     <Maps (UTF-8)>  
          u32 filename string length
          <If not zero>
               sc8 branch map filename
          u32 filename string length
          <If not zero>
               sc8 branch normal map filename              
          u32 filename string length
          <If not zero>
               sc8 imposter branch map filename
          u32 filename string length
          <If not zero>
               sc8 imposter branch normal map filename              
          u32 filename string length
          <If not zero>
               sc8 leaf map filename
          u32 filename string length
          <If not zero>
               sc8 leaf normal map filename
          
     <S Branch Indices>
          <For every index>
               u16 index
    
     <I Branch Indices>
          <For every index>
               u16 index
    
     <Leaf Indices>
          <For every index>
               u16 index
              
     <S Branch Vertices>
    
          <For every vertex>
               r32 position.x
               r32 position.y
               r32 position.z
          <For every vertex>
               u32 color      // Packed RGBA
          <For every vertex>
               r32 normal.x
               r32 normal.y
               r32 normal.z
          <If IS is texture space origin TL>
               <For every vertex>
                    TL.u
                    TL.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <If IS is texture space origin BL>
               <For every vertex>
                    TR.u
                    TR.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <If IS is texture space origin TR>
               <For every vertex>
                    BL.u
                    BL.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <If IS is texture space origin BR>
               <For every vertex>
                    BR.u
                    BR.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <For every vertex>
               r32 fwor.x
               r32 fwor.y
               r32 fwor.z
               r32 fwor.w
              
     <I Branch Vertices>
    
          <For every vertex>
               r32 position.x
               r32 position.y
               r32 position.z
          <For every vertex>
               u32 color
          <For every vertex>
               r32 normal.x
               r32 normal.y
               r32 normal.z
          <If IS is texture space origin TL>
               <For every vertex>
                    TL.u
                    TL.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <If IS is texture space origin BL>
               <For every vertex>
                    TR.u
                    TR.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <If IS is texture space origin TR>
               <For every vertex>
                    BL.u
                    BL.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z
                    r32 tangent.w
          <If IS is texture space origin BR>
               <For every vertex>
                    BR.u
                    BR.v
                    r32 tangent.x
                    r32 tangent.y
                    r32 tangent.z  
                    r32 tangent.w            
          <For every vertex>
               r32 fwor.x
               r32 fwor.y
               r32 fwor.z
               r32 fwor.w
              
     <Leaf Vertices>     // NOTE: Leaf normals and tangents are NOT stored - they are calculated in shaders
    
          <For every vertex>
               r32 position.x
               r32 position.y
               r32 position.z
          <For every vertex>
               u32 color
          <If IS is texture space origin TL>
               <For every vertex>
                    TL.u
                    TL.v                    
          <If IS is texture space origin BL>
               <For every vertex>
                    TR.u
                    TR.v                    
          <If IS is texture space origin TR>
               <For every vertex>
                    BL.u
                    BL.v                    
          <If IS is texture space origin BR>
               <For every vertex>
                    BR.u
                    BR.v
          <For every vertex>
               r32 fwor.x
               r32 fwor.y
               r32 fwor.z
               r32 fwor.w
          <For every vertex>
               r32 llod              
          <For every vertex>
               r32 xyor.x
               r32 xyor.y
               r32 xyor.z
               r32 xyor.w
          <For every vertex>
               r32 cuva.x
               r32 cuva.y
               r32 cuva.z
               r32 cuva.w
              
     <Branch Directory>          
          u32 directory_size_in_bytes
                              
          <For every branch (s branch count + i branch count)>
               s32 parent id
               u32 node count
               uc8 branch level
               bl  is imposter branch
               u32 branch start index
               u32 branch index count
               u32 branch start vertex
               u32 branch vertex count
               u32 leaf count
               <For every leaf on branch>
                    u32 leaf start index
                    u32 leaf start vertex

     <Branch LOD Levels>
    
          <For every branch lod level>
               u32 s branch index count
               u32 s branch vertex count
               u32 i branch index count
               u32 i branch vertex count
    
     <Leaf LOD Levels>
    
          <For every leaf lod level>
               u32 leaf index count
               u32 leaf vertex count
(This post was last modified: 05-03-2011 09:14 AM by dylantan.)
05-03-2011 09:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Rabishan Offline
Member

Post: #9
RE: Importing Woody3D Tree Models
hi esenthel,

woody have provided me with the binary files. now can you please tell me where to create the function to load the trees and maybe some tips.
also i actually wanted to import these trees in the editor environment. so that it would be easy to deal with.
so how would it help me after i created the function you suggested.

thanks for the support so far though
05-03-2011 10:28 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: Importing Woody3D Tree Models
You cant do this in the editor. Just make your own exe and manually call import function.
05-03-2011 10:36 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #11
RE: Importing Woody3D Tree Models
(05-03-2011 10:36 AM)Esenthel Wrote:  You cant do this in the editor. Just make your own exe and manually call import function.

Sorry but I don't get what you mean. What do you mean by manually call import function? Could you elaborate a little more so that maybe we get an idea of how we could import 3rd party mesh format such as Woody3D into Esenthel without needing to access into Esenthel Core source code.

Please correct us if the following idea of ours is wrong:

Esenthel Engine ---> Custom Import Mesh Program (our own program? Load inside Esenthel Engine) --> Browse for Custom Mesh (i.e. Woody3D Tree mesh files after compiled) --> Load into Esenthel World Editor -- > Place Tree mesh on Terrain (using [Insert] key) as if it is an Object --> Use World Editor to move around the Custom Mesh File

Is the above flow sound right? Or we getting the whole wrong idea of what you were trying to tell us?
(This post was last modified: 05-04-2011 01:00 PM by dylantan.)
05-04-2011 12:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #12
RE: Importing Woody3D Tree Models
make program where you convert woody to .mesh

Bool convert(Str woody, Str mesh)
{
}
Bool Init()
{
convert("c:/woody.woody", "c:/woody.mesh");
}


now you have woody.mesh file which you can load in Editor
05-04-2011 04:37 PM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #13
RE: Importing Woody3D Tree Models
You know the structure for the woody files, now you just need to know the structure for wave front obj file (or esenthel mesh file, but for that you can just use the converter.exe, or any other file type you prefer).

Make a function like Esenthel said and parse the info from the woody file and convert it to a wavefront obj structure - good site: http://www.hodge.net.au/sam/blog/?p=250.
You'd be outputting the data in plain text while saving it as a *.obj. Read everything in that blog. There's also a code sample in python: "Writing the OBJ data to Disk using Python File I/O" and that's basically what you want your converter to do (from woody3d mesh to wavefront obj). I never tried to convert x to y before either.. seems tricky ha, good luck!
05-05-2011 12:32 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #14
RE: Importing Woody3D Tree Models
Thanks for the reply guys. Seriously we really appreciate it. You guys have been a nice lots, and do come back with real advice.

Don't mean to sound arrogant, but just would like to point out that this is just solves (if we able to solve it) only a part of it. If we look differebt angle, I am getting the feeling that Esenthel may not have the flexibility to add on 3rd party tools. What we plan to do with Woody3D and Esenthel seem like may not materialized after all.

Woody3D is just one of the many SDK and add ons thats available in the market. We also planned to use FaceFX which creates realistic facial animation from audio files which we plan to use it to create characters that can "talk" with certain facial animation from inside of Esenthel. From the looks of the current situation, I think we may not able to use this for Esenthel. Please correct me if I am wrong guys, I dont mean to offend.

But nonetheless, Esenthel still a powerful engine and so far we are happy with it plus its come with a lot of features that we can't resist. I hope there is ways we could include 3rd party SDKs, plugins and addons to enhance the core Engine.

Again thanks for the valuable advice.

(05-05-2011 12:32 AM)Dandruff Wrote:  You know the structure for the woody files, now you just need to know the structure for wave front obj file (or esenthel mesh file, but for that you can just use the converter.exe, or any other file type you prefer).

Make a function like Esenthel said and parse the info from the woody file and convert it to a wavefront obj structure - good site: http://www.hodge.net.au/sam/blog/?p=250.
You'd be outputting the data in plain text while saving it as a *.obj. Read everything in that blog. There's also a code sample in python: "Writing the OBJ data to Disk using Python File I/O" and that's basically what you want your converter to do (from woody3d mesh to wavefront obj). I never tried to convert x to y before either.. seems tricky ha, good luck!
(This post was last modified: 05-05-2011 07:04 AM by dylantan.)
05-05-2011 07:01 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #15
RE: Importing Woody3D Tree Models
I am not entirely sure what's limiting you... So you want the trees generated from Woody3d to work in Esenthel? To do that you must convert that format into a format that Esenthel, or any other engine you're using for that matter, recognizes (be it a wavefront obj/Esenthel mesh).

It doesn't matter if you're using the Unreal/Irrlicht/Hero/Leadwerks engine, or whatever engine you may find, it's up to you, the programmer to add in whatever feature you want, hence 3rd party component. Since Esenthel is in c++ and Woody3D is too, there's not much that would limit you from a successful integration, unless of course you want to merge the actual rendering engine from Woody3D into Esenthel.. you'd need a beefy wallet for that smile

Same goes for FaceFX. There's even a Facial Animation tutorial in 4 - Demos, Game Basics\Demos. I'm positive you can get FaceFX to work using that.
05-06-2011 12:42 AM
Find all posts by this user Quote this message in a reply
Post Reply