<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Exporting to Babylon JS in FBX Forum</title>
    <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040582#M1029</link>
    <description>&lt;P&gt;I see sorry for the confusion.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 13:31:13 GMT</pubDate>
    <dc:creator>Christoph_Schaedl</dc:creator>
    <dc:date>2019-09-23T13:31:13Z</dc:date>
    <item>
      <title>Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040318#M1023</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to develop a custom exporter to babylonjs by I have a problem with the control points.&lt;/P&gt;&lt;P&gt;If I have a cube, the control points are 8 ( vertices ) and babylonjs requires that I assign a normal for each control point ( same also for the UVs )&lt;/P&gt;&lt;P&gt;Obviously the normals are not enough. In babylonjs a cube is represented with&amp;nbsp; 24 control points and 24 normals. Each control point have a unique normal.&lt;/P&gt;&lt;P&gt;I found the call 'EmulateNormalsByPolygonVertex' that generates 36 control points/ normals and the geometry looks ok, but it is a waste of resources.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I generate 24 control points/normals ?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:22:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040318#M1023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T11:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040338#M1024</link>
      <description>&lt;P&gt;I would export the data to Blender and go from there.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:35:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040338#M1024</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2019-09-23T11:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040512#M1025</link>
      <description>&lt;P&gt;I don't understand: blender is not an exported file format. I see only .dae, .obj and .dxf.&lt;/P&gt;&lt;P&gt;I don't know if I'm writing to the wrong forum, but I'm talking about the fbx sdk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:07:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040512#M1025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T13:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040536#M1026</link>
      <description>&lt;P&gt;Right but Blender does have one of the best BabylonJS exporters.&lt;/P&gt;
&lt;P&gt;Export your data first to Blender and export to BabylonJS from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.blender.org/" target="_blank"&gt;https://www.blender.org/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/BabylonJS/BlenderExporter" target="_blank"&gt;https://github.com/BabylonJS/BlenderExporter&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:17:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040536#M1026</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2019-09-23T13:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040552#M1027</link>
      <description>&lt;P&gt;Please take a look at the ExportScene03 sample. The function CreateCubeWithTexture is creating a cube with 24 points and normals. With the FBX SDK you have the full control on how you create your geometries. The implementation really depends on your goals.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:22:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040552#M1027</guid>
      <dc:creator>regalir</dc:creator>
      <dc:date>2019-09-23T13:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040576#M1028</link>
      <description>&lt;P&gt;Thank you for your answer, but I'm looking to something different. I'm a c++ developer and I'm using the fbx sdk to write a custom exporter. I'm not searching for a way to export in babylon js, but for a way to force the sdk to arrange the geometry in a different way&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:29:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040576#M1028</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T13:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040582#M1029</link>
      <description>&lt;P&gt;I see sorry for the confusion.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:31:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040582#M1029</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2019-09-23T13:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040596#M1030</link>
      <description>&lt;P&gt;I've seen this example, but I'm reading a file not created by me.&lt;/P&gt;&lt;P&gt;So if I read for example a cube written by 3ds, it has 8 control points.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040596#M1030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T13:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040806#M1031</link>
      <description>&lt;P&gt;The FbxGeometryConverter::EmulateNormalsByPolygonVertex is the correct function to call. It will add the required numbers of control points to match the number of normals defined on each polygon vertex. So, in the case of the cube, you will effectively end-up with 24 control points, instead of 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;before:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	Geometry: 3176076104288, "Geometry::", "Mesh" {
		Properties70:  {
			P: "Color", "ColorRGB", "Color", "",0.0313725490196078,0.431372549019608,0.529411764705882
		}
		Vertices: *24 {
			a: -5,-5,0,5,-5,0,-5,5,0,5,5,0,-5,-5,10,5,-5,10,-5,5,10,5,5,10
		} 
		PolygonVertexIndex: *24 {
			a: 0,2,3,-2,4,5,7,-7,0,1,5,-5,1,3,7,-6,3,2,6,-8,2,0,4,-7
		} 
		Edges: *12 {
			a: 0,1,2,3,4,5,6,7,9,11,13,17
		} 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after:&lt;/P&gt;
&lt;PRE&gt;	Geometry: 2329100146640, "Geometry::", "Mesh" {
		Properties70:  {
			P: "Color", "ColorRGB", "Color", "",0.0313725490196078,0.431372549019608,0.529411764705882
		}
		Vertices: *72 {
			a: -5,-5,0,-5,5,0,5,5,0,5,-5,0,-5,-5,10,5,-5,10,5,5,10,-5,5,10,-5,-5,0,5,-5,0,5,-5,10,-5,-5,10,5,-5,0,5,5,0,5,5,10,5,-5,10,5,5,0,-5,5,0,-5,5,10,5,5,10,-5,5,0,-5,-5,0,-5,-5,10,-5,5,10
		} 
		PolygonVertexIndex: *24 {
			a: 0,1,2,-4,4,5,6,-8,8,9,10,-12,12,13,14,-16,16,17,18,-20,20,21,22,-24
		} 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 14:55:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040806#M1031</guid>
      <dc:creator>regalir</dc:creator>
      <dc:date>2019-09-23T14:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040907#M1032</link>
      <description>&lt;P&gt;In my case I end up with 36 control points instead the optimal 24. Do you know why ? Any suggestion ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:31:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9040907#M1032</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T15:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9041297#M1033</link>
      <description>&lt;P&gt;The file you are working with contains a triangulated cube. Each face is not a quad but rather,&amp;nbsp; two triangles. This adds the extra 12 vertices. If you call FbxMesh::IsTriangleMesh(), you should get &lt;STRONG&gt;true&lt;/STRONG&gt;, indicating that all the polygons in the mesh are triangles. This is certainly a valid mesh and I can only hope that Babylon JS does support triangles. If not, you will have to implement your own functions to convert the triangulated meshes into quads.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 18:14:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9041297#M1033</guid>
      <dc:creator>regalir</dc:creator>
      <dc:date>2019-09-23T18:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9041481#M1034</link>
      <description>&lt;P&gt;The file I’m working is triangulated, but my problem is the number of the control points: they are 8 and are not enough to define the normals. I need 24 control points.&lt;/P&gt;&lt;P&gt;Do you know how I can force fbxsdk to generate 24 control points ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 19:49:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9041481#M1034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T19:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9041607#M1035</link>
      <description>&lt;P&gt;In the FBX SDK. It is perfectly normal to only have 8 control points (FBX definition of the control point is: the physical 3D coordinate) and 36 vertices (a vertex is the point of one polygon).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I wrote earlier, when you call the FbxGeometryConverter::EmulateNormalsByPolygonVertex(...), the function will duplicate the 8 control points so each control point is matching each polygon vertex. In the case of your cube, because there are 36 vertices, you will get 36 control points.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you absolutely want 24 control points, you need to de-triangulate the mesh to get back 6 quad faces instead of 12 triangular faces (and you will need to write your own code because this functionality is out of the scope of the FBX SDK).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the other hand, if you want to access the control points to re-compute the normals (they should already be present in the file), you need to "walk" the polygons so you can get the 3d coordinate from the polygon vertex index (see DisplayMesh.cxx from the ImportScene sample).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;int i, j, lPolygonCount = pMesh-&amp;gt;GetPolygonCount();
FbxVector4* lControlPoints = pMesh-&amp;gt;GetControlPoints(); 
int vertexId = 0;
for (i = 0; i &amp;lt; lPolygonCount; i++)
{
    int lPolygonSize = pMesh-&amp;gt;GetPolygonSize(i);
    for (j = 0; j &amp;lt; lPolygonSize; j++)
    {
	int lControlPointIndex = pMesh-&amp;gt;GetPolygonVertex(i, j);
	if (lControlPointIndex &amp;lt; 0)
	{
		DisplayString("            Coordinates: Invalid index found!");
		continue;
	}
	else
		Display3DVector("            Coordinates: ", lControlPoints[lControlPointIndex]);
    }&lt;BR /&gt;}
...&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Sep 2019 20:45:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9041607#M1035</guid>
      <dc:creator>regalir</dc:creator>
      <dc:date>2019-09-23T20:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to Babylon JS</title>
      <link>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9042282#M1036</link>
      <description>&lt;P&gt;Thank you for the answer. It is not what I was searching, but at least I know that if I develop my own algorithm I'm not reinventing the wheel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 07:08:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fbx-forum/exporting-to-babylon-js/m-p/9042282#M1036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-24T07:08:24Z</dc:date>
    </item>
  </channel>
</rss>

