Daz Loyalty Rewards

As our thanks, please enjoy an EXTRA 00% OFF all your purchases through the end of 2016, INCLUDING NEW RELEASES!

(Discount excludes Gift Cards, applies at check-out.)


Alessandro_AMAlessandro_AM Posts: 1,877

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,000
    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,877
    edited December 1969


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

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

  • Richard HaseltineRichard Haseltine Posts: 29,653
    edited December 1969

    Shouldn't there be parentheses at the end?

  • rbtwhizrbtwhiz Posts: 1,000
    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,877
    edited December 1969

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

  • Richard HaseltineRichard Haseltine Posts: 29,653
    edited December 1969

    Thanks Rob, an interesting site.

Sign In or Register to comment.
Rocket Fuel