Many games nowadays use models built from programs like 3DsMax to use in their programs. I was just wondering how hard it would actually be for them to code them by hand ? What is involved in coding a model by hand ? By this, i mean. Do they just use lots of pixels? do they use shapes and apply matrix transformations to make them differant shapes (i have been informed matrices are important in the construction of games, however i cannot think of anythingother than transformations they may be useful for). So, basically, "How do they (or how "would" they) code a model by hand?".
Matricies are used not just because of tranformations, they are used in lots of algos (such as spell checking). Coding a model by hand, woh, not done much now adays, you normally take a model, and apply the physics engine which do things such as rag doll modeling (puts penny in the games industry buz word jar). Anyway if your coding it by hand normally the code is somewhat similar to 2D vector methods, except a vector for 3D. Think when you code events for a window changing size, its very similar to that, you just see in your head or on a paper design how you want tit to work, and you just right it.
so what ? i draw a picture, then when it comes to coding, i might go... "well i need a line now..." and thus i use the line() command (or whatever) to draw it ? but stuff with coded models in are really small, wouldnt that make it big ? since a model will end up with a helluva lotta code! do you know of any websites which go into more details on the uses of matrices in programming ? thanks!
The 'line' code is implimented by the 3d acceleration. The pixelated data is then stored in a buffer until its needed to be modified. no useful links sorry!
It sounds like you're asking about procedurally generating models. The general approach is to modify and combine simple shapes through matrix transformation and CSG (constructive solid geometry). You could construct a modelling tool that allowed you to apply arbitrary matrices to a selection of predefined shapes (probably with parameters to tessellate the shape more or less). So for example if you want a cube twisted along one of it's axes, don't store all the triangle vertices you would need. Just store something that like "cube, size x, twist matrix". With a 4*4 float matrix and a couple of bytes extra for shape ID and size, you're looking at 66 bytes. Storing 3 floats for a single vertex, and 3 vertices for a triangle you're looking at 36 bytes per triangle. Two triangles already comes to more than 66 bytes and try modelling a twisted cube with two triangles . Modelling using curves also requires less storage, because you'll normally just be storing a few control points, tangents, etc. and then can generate dense triangle meshes from those.
so, say for instance i wanted to make a saucer, like aflying saucer. I may, get a sphere, then use matrices transformations to compress 2 ends ? and if i wanted to stretch it, i may apply another transformation. So (in 2d)... Thanks
matrix transformations are very powerful because while you logically think of that as two operations, you could make just one transformation matrix to do both. http://msdn.microsoft.com/library/en-us/gdi/cordspac_4tma.asp is the structure used in windows GDI for matrix transforms. Used primerally in vectors, but you can use it with regions, indeed some code i made ages ago for transparancy, used this to scale the region.
Check out GMax Its a bit of a side issue to the actual question but the authors of 3dsMax have had (for quite some time a freeware version - albeit limited functionality; but more than a plebian like me needs!) http://www.discreet.com/products/gmax/ Great fun to play with ..... and also shows (to me) the instrinic understanding of maths required to even begin a modelling program. Good luck to yer
it wouldnt be a modelling program as such, just a program with a coded model with mathematics applied to parts of it to make it move. I think i might code a tron and then create a device driver for some kind of gloves so you can make him punch, that would be ace