|
![](/i/fill.gif) |
I have been working on a C# library so I can write mesh editing software... Here is a
(very early) test output.
This was generated with a simple loop in C# and the components themselves generate the
mesh2 object...
Here's a C# snippet from my test app. I wrote a function named "Function" that
returns a mathematical y value for any x
and z).. The resultant mesh is 19K lines of text, 12800 faces (triangles) and 6561
vertices. It automatically re-uses
identical vertices.
There are no Normals or UV Mapping yet, and I have no clue what might happen if there
were groups nested inside each other.
The fun bit is that I can get the POV output for any object from this one line of
code...
string POV = a_thing.toPOV();
----------
BV3D.group a_thing = new BV3D.group("A Test Thing");
int J = 40;
for (int x = -J; x < J; x++)
{
for (int z = -J; z < J; z++)
{
{
BV3D.triangle t = new BV3D.triangle();
t.A.setVector(x, Function(x,z), z);
t.B.setVector(x + 1, Function(x+1, z), z);
t.C.setVector(x + 1, Function(x+1, z+1), z + 1);
a_thing.triangles.Add(t);
}
{
BV3D.triangle t = new BV3D.triangle();
t.A.setVector(x, Function(x, z), z);
t.B.setVector(x, Function(x, z+1), z + 1);
t.C.setVector(x + 1, Function(x+1, z+1), z + 1);
a_thing.triangles.Add(t);
}
}
}
string POV = a_thing.toPOV();
Post a reply to this message
Attachments:
Download 'mest2test.jpg' (35 KB)
Preview of image 'mest2test.jpg'
![mest2test.jpg](/povray.binaries.images/attachment/%3C4876cfb4%40news.povray.org%3E/mest2test.jpg?ttop=443866&toff=3150&preview=1)
|
![](/i/fill.gif) |