Testing Log


Testing Log

Permalink 03:59:16 am, Categories: Coding Log, Testing Log  

So - back to work on COLLADA conversion. I'm still reworking the 3d surface triangulation algorithm I originally wrote last summer, but with all the changes to the rendermanager and such, I've mostly been getting caught up with setting up a good testing environment. In order to isolate and identify bugs in the code I wrote, I am attempting to visualize the 3D surface triangulation using a csSimpleRenderMesh. So, once triangulated, the csTriangleMesh is converted to a csSimpleRenderMesh, and then visualized. I am having difficulty right now trying to visualize this. I can't seem to get the csSimpleRenderMesh to appear on the screen. Part of the situation was in getting the render manager set up and working, but now that seems to be finished.

I have the following code setup to perform the rendering of what (I believe) is a simple triangle:

void Tri3DTest::Frame()
// we want to draw result
csSimpleRenderMesh rendMesh;

csVector3 verts[2];
verts[0].Set (0, 0, 0);
verts[1].Set (10.0, 0, 0);
verts[2].Set(0, 10.0, 0);

csVector4 cols[2];
cols[0].Set(1.0, 0.0, 0.0, 1.0);
cols[1].Set(1.0, 0.0, 0.0, 1.0);
cols[2].Set(1.0, 0.0, 0.0, 1.0);

rendMesh.vertices = verts;
rendMesh.vertexCount = 3;
rendMesh.colors = cols;

rendMesh.meshtype = CS_MESHTYPE_TRIANGLES;
csAlphaMode alf;
alf.alphaType = alf.alphaSmooth;
alf.autoAlphaMode = false;
rendMesh.alphaType = alf;

g3d->BeginDraw(engine->GetBeginDrawFlags() | CSDRAW_3DGRAPHICS);
g3d->DrawSimpleMesh(rendMesh, 0);

However, all I get is a black screen. I should say that a bit ago, I got a black screen. Now, I added the line view->Draw() and get a segfault. This was due (in part) to the rendermanager not being set correctly. This problem has been corrected, but I am rebuilding the Crystal Space core library at the moment, as I was previously getting a number of weird errors with walktest. Walktest displayed, but not like it did previously, without the new rendermanager code in the trunk. The level seems to be full of errors now. I thought perhaps it could be my platform, along with some weirdness in incremental linking with the msvc compiler, so I am rebuilding things just to be sure. Once this is complete, I will see if the new 3D triangulation test visualization works.

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Trackbacks, Pingbacks:

No Trackbacks/Pingbacks for this post yet...

Comments are not allowed from anonymous visitors.

March 2017
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31  




XML Feeds

What is this?

powered by