Sign in to follow this  

cloning mesh

This topic is 4109 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 guys, i'm writing a 3d game and i have a map like a chess board,and i have a mesh that has dimensions of a square in the map.I want to copy that mesh,its a wall and put more of them to different positions on the map.How can i copy that. I first rendered that in a place,translated to another point and rendered again,but if i have many of them it starts to render very slow,is there a better way.By the way,i do it in D3d9, thank you very much,every help will be appreciated.

Share this post


Link to post
Share on other sites
If they are static objects, pretransform them and put all of them into a single vertex buffer. You can go up till 4MB per VB before starting a new one. Then it will be only a few draw calls.

Share this post


Link to post
Share on other sites
Quote:
Original post by darkelf2k5
If they are static objects, pretransform them and put all of them into a single vertex buffer.
I concur. If the geometry is static and you're not memory-limited then just store multiple copies of the data.

Quote:
Original post by darkelf2k5
You can go up till 4MB per VB before starting a new one.
There were mentions of 4mb being optimal on some hardware (but I've not seen that mentioned for more recent GPU's) - its most definitely not a limit though. You can quite legitimately create VB's that are a 100 fold larger [smile]

hth
Jack

Share this post


Link to post
Share on other sites
thanks,so i need to make a
LPDIRECT3DVERTEXBUFFER9 vb ,
and copy the vertices here.
but,i need to know the FVF,vb size and such,also what else?
And when i getfvf(), i get a numbe 274.That is ,do i need to know what is inside this to create the buffer?

Share this post


Link to post
Share on other sites

This topic is 4109 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this