#### Archived

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

# Some miscellaneous questions...

This topic is 5641 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi dudes! Here are some questions for the strongest amongst you : 1. Has someone heard about an algorithm that sorts values without performing any comparisons? I believe it''s called "bubble sort" but I''m not sure. This algorithm only has to increment values in an array, and then these values become the ranks of the values to be sorted. If someone could explain to me how it exactly works, that''d be kinda nice. 2. Despite all my pains, I''ve not been able to find what mipmapping is. That''s kinda pain in the ass. Could someone explain to me what it consists of, please?? 3. I would also like to learn about "Voxels", what this word means, what voxels are used for, what they are made out of, and so on... 4. I have noticed an object represented in 3D often have faces made with many parallel polygons that make an only face (for example, see the cylinder in DX8 SDK''s MeshViewer). Why do people put several rectangles insted of simply using an only one to represent a face? Actually I think this way can improve the lighting management but I would like to be answered by someone who knows. 5. Here''s the last one ( finally!!) : how come some polygons are made out of 2 triangles sharing an edge, whereas some rectangles are simply made with four vertices?? What kind of polygon should I use if I only want to map a texture on a plane square in 2D with Direct3D8. Thanks to all.

##### Share on other sites
Hi, I'll try to answer your questions, just to see if I can =]
1. Sorts like radix sort, bucket sort, etc. don't do any comparisons between values. A simple example of a sort like this is, say you have an array A of ints in the range 0 to 1000 that you want to sort. TO sort this w/o comparisons you can create an array B of 1000 ints and iterate through A counting the numbers of times each value, say 42, occurs.

2. Mipmapping is just decreasing the resolution of textures depending on an object's distance from the viewer. If you have a cube that only will be rendered covering 6 pixels you don't need to use a 1024x1024 texture on it.

3. Voxels are "volume pixels" for when you want to render volumes like clouds, fog, brains from mri imaging... Not sure exactly how oyu render them, but there is something on hardware, I think, called a "fog buffer" that would probably help for this.

4. Yeah, it is for lighting. For example if you are doing per vertex shading like Gourad shading what you do for the lighting is calculate the lighting equation at each vertex and then interpolate these values across all the pixels of the polygon. What can happen with this is that specular highlights, which are the reflections of light you see on shiny surfaces like metal or hard plAStic, if they fall completely inside of the polygon (i.e. the outer cone of a spotlight falls completely inside) and don't hit any vertices then they won't show up at all.
hope this is a good explanation
-erc
edit: corrected "volume textures" to "volume pixels"

[edited by - gurgi on June 5, 2003 12:53:39 AM]

##### Share on other sites

Don''t mean to be a pain in the ass, voxels are volume *pixels* ( pixels with depth as third coordinate). As gurgi said, you can apply them for fog, clouds etc. If you want to convert them to triangles, you will have to apply some sort of marching cubes algorithm.

Edo

##### Share on other sites
5. Polygons are NOT two triangles sharing an edge ... polygons are objects defined by 3 or more points which lie on the same plane.

All polygons may be represented exactly (without precision loss) by breaking them down into their constiuent trianges ... so a 4 point rectangle is a rectangle, but it can be represented as 2 triangles which share an edge ... a pentagon is a five point polygon ... which can be represented as 3 triangles, with 2 shared edges ... just drawn out any polygon on a piece of paper, and try to figure out how you could define the exact same area with as few triangles as possible. This is similar to what factoring is in mathematics. Amoung other things, one reason this is done, is that it is a lot easier to optimize a vertex pipeline for triangles and triangle strips, then to optimize it for arbitrarily complex polygons ... (some video cards render native rectangles quite fast as well ... but I don''t know of any that can accelerate hexagons, octagons, and all maner of strange polygons without first converting them to triangles or triangle strips).

##### Share on other sites
Hi brothers !!

I really dont know whether youre gonna read this post but I still want to thank you very much for the explanations, it''s been quite useful for me.
Now I have also understood that I''m not forced to draw 2 triangles before mapping the textures on 6 vertices each time I wanna draw a square, when the program neednt be too fast. That''s really a good new because that kinda f***** with me.

THAAAANKS BUDDIES !!!!!!!!!!!

##### Share on other sites
Not that it''s very relevant but voxel could equally be formed from a contraction of ''volume element'', just as pixel is a contraction of ''picture element''.

1. 1
Rutin
36
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633345
• Total Posts
3011441
• ### Who's Online (See full list)

There are no registered users currently online

×