How do I place 2 connected models

Started by
7 comments, last by Zeke 20 years, 8 months ago
I have my 2 meshes (just simple blocks) and I want them to be connected (so i eventually have a chessboard), but i cant figure out how to position them so they are right next to each other. Im using the D3DX library functions to place them at the moment (which is the reason the question is in the direct x forum because I think that will affect what I have to do), the 1st one I "translate" to 0,0,0 but what do i need to translate the 2nd one to, to get put it at, say, the right hand side of the first block. I know it has to be x,0,0 where x is a positive number but I dont know what number x needs to be. Thanks for any help you can offer.
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
Advertisement
why not just make it one mesh?
Because where''s the fun in that? hehe nah I''m just messing around at the moment really, just learning the ropes if you will, and i thought it would teach me more to have a number of meshes connected rather than just one big mesh. Also my 3d modelling skills are basically non-existant and i dont know how to make a big chessboard with black and white squares on it.
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
the x your looking for is the size of the block, use trial and error or open the .x file in notepad and try to find the right number
If its designed around the center, then you need to make X = Block_Size_in_Units/2. If its designed around one of the corners, it just needs to be X=BlockSize


______________________________
Quantum
CEO of Quantum Rebound Software
Website Up Soon
______________________________QuantumCEO of Quantum Rebound SoftwareWebsite Up Soon
You could also use the ComputeBoundingBox function to get the relative coordinates of the edges.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
If they''re just boxes, why are you using meshes anyways? That''s just overcomplicating things.

The simplest thing to do would be to create a single block (36 vertices...just hard code it), and tile it over the scene.

Hell, you could even generate the whole board procedurally, if you really want.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

Thanks for the replies guys, Ive decided to forget the meshes and code the board into an indexed vertex buffer.
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
You can use ID3DXMatrixStack. It might help a little.

.lick

This topic is closed to new replies.

Advertisement