| Buy Premium MC accounts CHEAP Click here |
Respected seller.
Check my vouches in the first post of the above MC account thread ^
alright, let me explain this in simple terms for you.
A 3D object has a number of edges that defines its point. A cube, for example, has eight of these points. These points are called vertices.
To draw a box in DirectX, you must first define where these points are. We use a special structure for this:
As you can see, our vertex consists of two pieces of data - the position and color. We define these points in a 3D space, and each edge has its own color that will be mixed with the other edges.Code:struct Vertex { VECTOR3 position; DWORD color; }
You then pass this data to the graphics card, which will draw a cube from those points for you, with those colors. Of course, games don't use colors - they use textures ! That's about all a box, or any other object is - a bunch of interconnected points. Heck, your player models are just aggregations of 20 million of these points, which gives the illusion of a smooth shape, like how a curved line can be drawn from many straight lines slightly different from the previous!
I hope I've adequately explained the basics for you. If not, sorry, my phone restricts what I can type.
Last edited by freedompeace; 04-09-2011 at 06:49 PM.
flameswor10 (04-09-2011)
that will be a waste .. and really i dont think they are much people here with the DirectX skills to do that.
@Freedomepeace : A cube have 6 faces, 8 points, you dont need all those points to draw a smooth curve because directX does an effect that make things look smooth for you. and you forgot to give the the CustomFVF
@ who ever cares : Remember i give you a source for Texture Mapping, well that is simular to this, It simply Draws a 2D Rectangle consisting 4 points/vertexes. Then Maps a texture around the using the UV coords.
I release an effect of a spinning Box with a texture mapped around each face. I also added lighting :P and stuff but we talking about 3d Objects.
a Textured object requires uv coordinates. to position the texture aroung the face, you can pull it in some places and shrink it in others.
I have a little example source of a Texture being mapped around a Rectangle in 3D space if you want is MSN me
finish101@hotmail.com
Last edited by topblast; 04-09-2011 at 11:43 AM.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
topblast, you make good points, but they are irrelevant. I was giving a simplified explanation, not programmatic tutorial.
"A cube have 6 faces, 8 points, you dont need all those points to draw a smooth curve"
How do you get a smooth curve out of a square? 0.o
"you forgot to give the the CustomFVF"
No I didn't (:
"Remember i give you a source for Texture Mapping, well that is simular to this, It simply Draws a 2D Rectangle consisting 4 points/vertexes. Then Maps a texture around the using the UV coords."
I don't remember, but yeah that's all it is. Replace your colour with a texture coordinates, set the texture, and viola :)
"How do you get a smooth curve out of a square? 0.o"
Well i didnt mean for the squares, but you dont need so many points to make a smooth surface.
"No I didn't (:"
Sharing is caring
"I don't remember, but yeah that's all it is. Replace your colour with a texture coordinates, set the texture, and viola "
Here you go sir
https://www.mpgh.net/forum/207-combat-arms-hack-coding-source-code/241824-texture-mapping-drawtexbox.html#post3356114
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development