Congratulations! You are a March Madness BONUS BUYER!

Enjoy 10% OFF* ALL PURCHASES STOREWIDE or enjoy 30% OFF items with a SKU number lower than 16000 & 30% OFF items from Runtime DNA.

Take an EXTRA 20% OFF of today's related items

Offer valid for intended recipient only
* 10% discount DOES apply to Gift Cards and Memberships. **Items must be in cart simultaneously for discount to apply.
[ collapse ]


Alessandro_AMAlessandro_AM Posts: 1,932

Any particular reason why the following code is crashing?
I'm trying to store some vertices into a DzVertexMesh...

    DzVertexMesh *vMesh;
    vMesh->addVertex(0.0, 0.0, 0.0);
    vMesh->addVertex(0.0, 1.0, 0.0);
    vMesh->addVertex(1.0, 1.0, 0.0);
    vMesh->addVertex(1.0, 0.0, 0.0);
Post edited by Alessandro_AM on


  • rbtwhizrbtwhiz Posts: 1,136
    edited December 1969

    At a glance, it would appear that you have declared a DzVertexMesh pointer, but you haven't defined it (i.e. = new DzVertexMesh).


  • Alessandro_AMAlessandro_AM Posts: 1,932
    edited December 1969


    #include "dzvertexmesh.h"
    DzVertexMesh *vMesh=new DzVertexMesh;

    actually gives a "allocating an object of abstract class 'DzVertexMesh'.

  • Richard HaseltineRichard Haseltine Posts: 32,572
    edited December 1969

    Shouldn't there be parentheses at the end?

  • rbtwhizrbtwhiz Posts: 1,136
    edited November 2012

    @Alessandro: Yeah, sorry... I was on my tablet, on the way out the door to take my wife to dinner. I didn't have anything other than your post in front of me at the time and the use of a declared but undefined pointer was an obvious issue that didn't require me to look at headers/definitions for more context. That is why I started my response with "At a glance". Now that I've had a chance to look at this when I'm not being rushed out the door... rather than DzVertexMesh, which you are correct is an abstract base class, use DzFacetMesh. You will obviously still need to define the pointer before you attempt to do anything with it, or you will cause a crash.

    @Richard: Take a look at this. It may even answer some questions you didn't even know you had.


    Post edited by rbtwhiz on
  • Alessandro_AMAlessandro_AM Posts: 1,932
    edited December 1969

    Yep, thank you very much Rob, will use the DzFacetMesh

  • Richard HaseltineRichard Haseltine Posts: 32,572
    edited December 1969

    Thanks Rob, an interesting site.

Sign In or Register to comment.