Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transparent objects




On Dec 25, 2004, at 2:33 AM, Lorenzo wrote:

So, I really think that this is not the way to proceed. I presume I can
solve this with some accumulation z buffer, collecting any object depth then
drawing all the objects at the end. But I don't know whether this method
exists or not.


Is anyone here who knows how to solve this "transparent" problem? Please.
There should be a solution, for sure!

Well it's pretty easy to determine the distance an object is away from the
"camera" if you know the location of your two objects.. (x,y,z). If your
camera is at (0,0,0) looking down the -z-axis, then the object with the
largest negative z coordinate is at the greatest depth and should be drawn
first. You would have to deal with other transformational and rotational
maths if you camera is at a different point and looking down and arbitrary
vector, but the math isn't very complicated.


I know that this isn't the best solution, but it probably is one of the
easiest. Like somebody else already pointed out, there really isn't a
great solution. If your objects overlap each other in 3d-space, you may
even have to sort polygons to make it look more accurate. Ideally, pixels
would be drawn to order, but I don't think you want to attempt that...



Chaz McGarvey http://www.brokenzipper.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >Re: Transparent objects (From: Lorenzo <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.