Jump to content
  • Advertisement
Sign in to follow this  
Ecko Freezy

Drawin Mesh (without model file)

This topic is 997 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

Hi guys,

 

in normal case I'm using .fbx models to draw my stuff ingame.

I just want to know how can I draw meshes without a .fbx model file.

 

For example, i want to draw some cubes.

I defined a Array for 100 cubes, the Array just includes the Position of the cube and the size.

Is it possible to draw this cubes or do i need to create model files for all this cubes first?

 

If it is possible, how can I add some texture to this cube mesh?

 

Greetz

ecko

 

 

Share this post


Link to post
Share on other sites
Advertisement

You can certainly do this. The rendering API has no idea where the data originally came from (model file, network stream or even defined at runtime).

 

You just need a way to define each vertex (a vertex buffer) and some way to define the ordering the vertices into triangles (an index buffer) and fill those with the data you want. For texturing, just make sure your vertices have UV coordinates and set the texture you want to use. The exact details of this depend on the engine/framework you are using and on the shaders used.

 

In theory you could even generate the data on the GPU completely using eg. the geometry shader, but lets' not go there. My point is just that the CPU does not even need to know about your meshes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!