sprockets A:M Decaling Screen frosted donut medals buildings Rubik's Cube Nidaros Cathedral Tongue Sandwich
sprockets
Recent Posts | Unread Content | Previous Banner Topics
Jump to content
Hash, Inc. - Animation:Master

Recommended Posts

Posted

patches.jpg

 

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;
}
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

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

  • Hash Fellow
Posted

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.

Posted

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

 

patches2.jpg

  • Hash Fellow
Posted

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!"

Posted

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.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...