Jump to content

  • Log In with Google      Sign In   
  • Create Account


D3DRMMESH


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 02 September 1999 - 02:52 PM

I converted a Meshbuilder which had already loaded a file in to a Mesh.

meshbuilder->CreateMesh( &mesh );

I added it to the scene and I tried to change the vertices using the SetVertices function. The problem is after doing so, everything works as it should, except the mesh is pitch black, even with the lights and everything. You can just see the silhoutte of the mesh.

what I did was:

D3DRMVERTEX vertices[3000];

. . . //put vertex positions in vertices[]

mesh->SetVertices(0, 0, vertnum, vertices);

But when I change the

D3DRMVERTEX vertices[3000];
to
D3DRMVERTEX *vertices = (D3DRMVERTEX *)malloc(sizeof(D3DRMVERTEX) * vertnum);

and then do the SetVertex call, it works better, but now it has flashy black and white alternating colours swirling around the mesh.

I have no idea what's wrong, the mesh should be white, and it is if I don't call the SetVertices function, but I need to change vertex positions often so I used D3DRMMESH instead of Meshbuilder.

When I set only a portion of the mesh vetices with the SetVertices function, those vertices are turned black, but the rest is white.

Please help, I don't know why the mesh turns pitch black or swirls with alternating black and white colours when I call the SetVertices function.

Thanks very much,


Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 02 September 1999 - 02:52 PM

Hmmm.. intresting, ive played around with RM too, not much with mesh manipulation on your scale but from my experience there could be several possiblitites:

-UV coordinates are being messed up by moving verticies. This is unlikly since you dont have any textures from your description.

-You have to recalculate normals for faces when you manipulate a mesh (not sure about this but you can check) I think RM uses normals to calcualte visiblity and lighting, which would fit the effects your describing of disappering faces and strange lighting.

So the struct for D3DRMVERTEX is as follows :

typedef struct _D3DRMVERTEX{
D3DVECTOR position;
D3DVECTOR normal;
D3DVALUE tu, tv;
D3DCOLOR color;
} D3DRMVERTEX;

As you can see if you dont init the normal, tu, tv, or color you'll proably experiecne that affect your describing. Yes thats proably it. Youll have to explicitly set those values.

Good Luck!

-ddn





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS