Archived

This topic is now archived and is closed to further replies.

Change the depth (z-axis) of a generated Mesh.

This topic is 5013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, There is my problem: I create a mesh with the method: TextFromFont(...); Everething work fine and I can view it without problem. But I need to change the depth of the generated mesh (I need to change de depth(z-axis) of each vertices of the figure and not with the world matrix of the device). Is there any way to do this? Thank alot for your help, Salutations,

Share this post


Link to post
Share on other sites
I think using the world matrix would be the easiest way to do this, but why don''t you want to do that? Changing each vertex requires manipulating the vertex and index buffers, which causes a severe performance hit if you do it too often. Whereas with the transformation matrix, you only have to save the current one, apply the shear matrix concatenated with it, then restore the original.

Share this post


Link to post
Share on other sites
Hello gang,


The problem is that I have a scene where each of my objects are at the same place (everything is created in a range (x,y,z) of (1,1,1). Everything work fine. Then this scene is rendered in a window that can be resize at will. The problem with pre-created mesh is that the dimensions and and place in the world is previously set ( (0,0,0)? (where is the (0,0,0) coordinates of the mesh, in the middle of the screen?). Then, If I want this mesh visible in my scene, I have to set new magic numbers for the camera for example. (ex: for my scene my camera is at -0.71f in LV, and I need my camera at -20.0f for a pre-created text mesh). If I begin to do this, I''ll have many many magic numbers in my code. So, I only need to "re-set" my meshs at the initialisation so the cost is really negligable.


Otherwise, is anyone have an idea to solve my problem?


I''ll retry to do this with the world matrix, but If I get other positions glitchs, I''ll try by locking vertexbuffer data and index.



Thank alot for your help!



Salutations,

Share this post


Link to post
Share on other sites
Hello,


Another thing I forgot is that I need to change the color of the text and the creation of the mesh is done with CustomVertex.PositionOnly vertices. I can''t do many things with this, it''s why I need to put these postitions in CustomVertex.PositionColored vertices.



Thank!


Salutations,

Share this post


Link to post
Share on other sites