About Store Forum Documentation Contact



Post Reply 
Help Needed On Creating PathMesh
Author Message
Otolone Offline
Member

Post: #1
Help Needed On Creating PathMesh
Hi there!
I have been trying to create a path mesh for a long time.
I don't know what I am doing differently.
Please read my code below and make some suggestions.
PHP Code:
PathSettings Path_Settings;
PathMesh Path_mesh;
PathWorld Path_World;
PathObstacle Path_obstacle;
MeshBase base ;
/******************************************************************************/
void InitPre()
{
   
EE_INIT();
   
App.flag=APP_MS_EXCLUSIVE;
   
Cam.dist=3;
}
/******************************************************************************/
bool Init()
{
     
base.create(3010VTX_TEX0); // 
   
base.vtx.pos (0).set(-100); // set #0 vertex position
   
base.vtx.pos (1).set( -101); // set #1 vertex position
   
base.vtx.pos (2).set0,00); // set #2 vertex position
  
   
base.vtx.tex0(0).set(-10   ); // set #0 vertex texture coordinates
   
base.vtx.tex0(1).set11   ); // set #1 vertex texture coordinates
   
base.vtx.tex0(2).set0,-1   ); // set #2 vertex texture coordinates
   
base.tri.ind (0).set012); // set triangle vertex indexes (#0 #1 #2 vertexes)
   
base.setNormals(); // set automatic vertex normals

   
base.setAutoTanBin(); // calculate tangents and binormals if needed
   
race_path.create((MeshBase&)baseVecI2(00), Path_Settings);
   return 
true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(
Kb.bp(KB_ESC))return false;
   
Cam.transformByMouse(0.0110CAMH_ZOOM|(Ms.b(1) ? CAMH_MOVE CAMH_ROT));
   return 
true;
}
/******************************************************************************/
void Render()
{
   switch(
Renderer())
   {
      case 
RM_PREPARE:
      {
         
         
LightDir(Cam.matrix.z).add();
      }break;
   }
}
/******************************************************************************/
void Draw()
{
   
Renderer(Render);
   
D.text(00.8"Tringles = "+base.tris());
   
D.text(00.7" Mesh base has data? "+base.is());
    
D.text(00.5"Path mesh has data? " Path_mesh.is());
}
/******************************************************************************/ 
As you can see the base mesh has data but the path mesh has no data and is not created.
Thanks in advance.
06-12-2018 07:02 AM
Find all posts by this user Quote this message in a reply
Otolone Offline
Member

Post: #2
RE: Help Needed On Creating PathMesh
Thanks for responding.
06-13-2018 06:50 AM
Find all posts by this user Quote this message in a reply
Post Reply