Styler Posted October 23, 2014 Posted October 23, 2014 I'm trying to build IEPatchModel like on picture (just 2 patches), but Hash is freezing on stage: hmc->MergeIEModel(model, "foo", 0.0, TRUE, TRUE);Can somebody tell me how to do it properly? What I'm doing wrong? Thanks. Here is a source code: void CreatePlane2() { float cps[] = { 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 2, 1, 0, 2, 0, 0 }; int faces4[] = { 0, 1, 2, 3, 3, 2, 4, 5 }; int numCps = 6; int numPatches = 2; // create model IEPatchModel* model = new IEPatchModel; for (int i = 0; i < numCps; i++) { model->m_vertexlist.Add(Vector(cps[i*3], cps[i*3 + 1], cps[i*3 + 2])); } // set up patches for (int i = 0; i < numPatches; i++) { IEPatch* patch = new IEPatch(NULL); model->m_patcharray.Add(patch); // sep patch indices for (int j = 0; j < 4; j++) { patch->m_vertexid[j] = faces4[i*4 + j]; } } HModelCache *hmc = HModelCache::New("plane"); hmc->MergeIEModel(model, "foo", 0.0, TRUE, TRUE); delete model; } Quote
Hash Fellow robcat2075 Posted October 23, 2014 Hash Fellow Posted October 23, 2014 I don't know the code answer but the sequence of the sides looks like it would make bad patches. Quote
Styler Posted October 23, 2014 Author Posted October 23, 2014 hmm... when i do extrusion of spline with 2 control points 2 times, shouldn't it be the same topology of patch model? it works fine for 1 patch. When i'm adding another one it causes an error Quote
Hash Fellow robcat2075 Posted October 23, 2014 Hash Fellow Posted October 23, 2014 hmm... when i do extrusion of spline with 2 control points 2 times... That sounds better. The diagram didn't look like that to me. Extruding a 2-point spline works if you do it manually in the modeler, so i don't know why it won't work in code. Quote
Styler Posted October 24, 2014 Author Posted October 24, 2014 I found the way of creation patches. Order of adding new faces looks like this. It's a shame that every single step in exploring SDK feels like fight for survival =(. If something goes wrong AM just hanging, no assert, no exceptions, nothing Quote
Hash Fellow robcat2075 Posted October 24, 2014 Hash Fellow Posted October 24, 2014 I found the way of creation patches. Order of adding new faces looks like this. That is interesting It's a shame that every single step in exploring SDK feels like fight for survival =(. If something goes wrong AM just hanging, no assert, no exceptions, nothing A:M is like the Soup Nazi. One mistake and "No soup for you!" Quote
Styler Posted October 24, 2014 Author Posted October 24, 2014 Ughhh, I had error in function that set Magnitude for all control points. I didn't check for infinite loop when I was getting next CPS from spline. That's why it was freezing. Actually basic technique from 1 picture works fine now. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.