Jump to content
  • Advertisement

Archived

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

dani333

Duplicate Mesh

This topic is 5283 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, I have mesh ( piece of ground) that i created , i need to uplicate it few times to different locations. For example i have ground 512X512 , starting point (0,0,0) end point (512,0,512), i need another 512X512 piece in location: starting point (100,0,100) end point (1024,0,1024) what shell i do? I also want to translate a chosen piece to another location how do i do that? Thanks:-)

Share this post


Link to post
Share on other sites
Advertisement
You need, to post what language you use (usually taken as c/c++), what gfx api you are using, and in what format are you storing your mesh (ie is it a d3dxmesh or a vb or a user buffer).

If you want the same strip translated, just make a translation matrix. If you want to have additional meshes, but of the same phyiscal structure, just copy and append them to your buffer, or add them to a new buffer then just modify the required vertex components.

If you are trying to make a game but do not understand the basics of the api and language I suggest that you scrap it and instead focus on learning the basics.

[edit]: you don't need 10 carriage returns at the end of your post either

[edited by - SoulSpectre on June 2, 2004 4:03:45 AM]

Share this post


Link to post
Share on other sites
Yes, I probably wasn''t clear enough, sorry for that.
Anyways, what I mean is, say, I have a model, somewhere on my screen, now, I want to duplicate it in another location. The model looks the same, moves the same, has the same polygons, only translated. The question is, can I duplicate it, to another location, without allocating and implementing a new geometry...Some kind of projection, or something. Now, this is not language dependant, but I use C++/OGL, without GLUT or other extentions.
Thanks in advance.

Share this post


Link to post
Share on other sites
All you have to do is call glTranslatef before drawing the model, and use glPushMatrix( ) and glPopMatrix( ) to save and load the previous matrix state e.g.:


//draw model here
glPushMatrix( )
glTranslatef(100, 0, 100)
//draw model here
glPopMatrix( )


Would draw one model at the origin and another at (100, 0, 100) and remember that in GL the negative Z axis goes into your screen so a model at (100, 0, 100) would be behind you unless you use a camera transform to move the scene around.

Share this post


Link to post
Share on other sites

  • 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!