hi

when i blend somthing, to make it be draw back to front i enable front culling,draw it, then enable back culling then draw it again. this is working fine for simple things like cubes etc but i was wondering would it be very practical on more complex objects? or will it be very slow and if it is how do i speed things up?

thanx in advance

All triangles that are suppsed to be blended has to be sorted at the same time. Front or back facing, doesn’t matter.

Your technique will work as long as your object is convex and you have one object only. As soon as you have a concave object and/or multiple object, it won’t work anymore.

[This message has been edited by Bob (edited 11-09-2002).]

im not sure what you mean by concave and convex? and since im drawing the object twice will this slow things down if its a complex object?

Originally posted by Bob:

[b]All triangles that are suppsed to be blended has to be sorted at the same time. Front or back facing, doesn’t matter.

Your technique will work as long as your object is convex and you have one object only. As soon as you have a concave object and/or multiple object, it won’t work anymore.

[This message has been edited by Bob (edited 11-09-2002).][/b]

I don’t really know how to describe convex and concave. But let’s take an example. Draw a circle on a paper. Now, take a ruler and try to draw a line that intersects the circle more than two times. You will see that it’s impossible. Any line can intersect the circle either zero or two times. Never four times, or one time. Therefore a circle is convex.

A concave object, on the other hand, has a shape that lets the line intersect more than two times. Considet the shape of a C.

-----

Here you can draw a line that intersects the shape more than two times. Therefore this shape is considered a concave shape.

Examples of convex shapes are spheres, cubes, cones and pyramids. Concave objects are, well, most objects with a somewhat complex shape.

and since im drawing the object twice will this slow things down if its a complex object?

Not that slow, but it will be some kind of performance hit. But as I said above, a complex objetc is likely to be concave, so your trick with drawing first back and then front faces won’t work. You have to sort them.

Concave vs. convex test: Draw your polygon, then connect every point of it with each other. If one of the connection lines is outside of the polygon, it is concave.