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

Started by
4 comments, last by NeoAsimov 20 years ago
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,
Advertisement
It involves locking the vertex and index buffers of the mesh, and changing the vertices'' position data.

I like pie.
[sub]My spoon is too big.[/sub]
Why don''t you want to use the World Transformation? It''s easy and efficient.

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
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.
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,
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,

This topic is closed to new replies.

Advertisement