|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| AddPolygonMesh with C# scripting
|
|
|
Hello,
Does someone know how to use the X3DObject.AddPolygonMesh() method when scripting with C#?
The following code does not work:
double[] vertices = new double[] {
0.0, 0.0, 0.0,
0.0, 0.0, 1.0,
1.0, 0.0, 1.0,
1.0, 0.0, 0.0};
int[] polygons = new int[] { // long does not work either
4, 0, 1, 2, 3};
X3DObject newMesh = root.AddPolygonMesh(
vertices, polygons, “newmesh");
Thank you in advance…
|
|
|
|
It works when replacing doubles and ints by objects:
object[] vertices = new object[] {
0.0, 0.0, 0.0,
0.0, 0.0, 1.0,
1.0, 0.0, 1.0,
1.0, 0.0, 0.0};
object[] polygons = new object[] {
4, 0, 1, 2, 3};
root.AddPolygonMesh(
vertices,
polygons,
“newMesh");
|
|
|
|
I am tring to get the c# scripting to work.
:/
|
|
|
|
Hi,
the C# support is based on the OM layer so native array types won’t work, you have to use arrays of type object which are equivalent to safearrays in the OM.
-mab
|
|
|
|
|
|