Originally Posted by parduz
I need a working sample code that shows me how to create a mesh by code, with different submesh and textures.
I've read a bunch of web page about it, but i can't figure out how i should do.
Wouldn't it be special if we all got what we "need" just be asking..
First of all (to clue you in) the number of working DirectX VB code samples is (and has always been) somewhat limited.
Many of the working code samples that you can/do find out there on the Internet are simply variations on the samples that come with the DirectX SDKs.
Here's a quote:
It doesn't take a genius to realise that these models are not hard-coded into the game - doing that would require 1000's of lines for each frame of an animation - not a very clever way of doing things.
..from the DirectX4Vb tutorial on "loading pre-created objects":
Also -- creating 3D mesh objects directly from code would be somewhat (very) tedious
That is why people who create 3D objects/models use special software that allows them shape 3D objects (including meshes) interactively using a GUI.
Then the 3D objects are saved to 3D model files which are then converted to DirectX files -- which can be loaded and manipulated using the DirectX API.
This definitely seems the standard way of doing things
If you do a search of the forum's LegacyVB DirectX section using the term "mesh" you'll find that most threads on the topic are from people who have trouble just loading a mesh from a pre-created DirectX file.
I'm not saying that the DirectX API doesn't have the means to create meshes manually. Unfortunately (as your research has probably shown..although it would have been helpful to cite the web pages you visited), most of the online MSDN documentation for DirectX is oriented toward the C/C++ programmer, including this page on the D3DXCreateMeshFVF function:
The only reason I could think of that your project would need to be able to create a mesh manually is if you where doing some kind of 3D modelling utility and if that is the case --good luck.
I have yet to see such a "sample" of a 3D interactive model editor written in VB.