frustum clipping u,v problem

Started by
4 comments, last by guya 14 years, 7 months ago
Hi, I am building a 3d portal engine and i already done a frustum clipping in 3d. I have a problem with the u v clipping because it making the texture bending and twisting (although the 3d card is doing perspective correction) I am using this formula for the u,v calculation (where s is the intersection point distance): u = u1 + s*(u2-u1) v = v1 + s*(v2-u1) What did i do wrong? Thanks, Guy
Advertisement
You used u1 in the second expression...
oops, i wrote it by mistake...

I'm using this formula:

u = u1 - s*(u2-u1)
v = v1 - s*(v2-v1)

and i have the texture bending problem while clipping..

[Edited by - guya on September 10, 2009 9:23:45 AM]
Are you manually clipping your triangles against the portals? If so, you really shouldn't. With modern hardware that kind of low-level messing with your data will kill performance. Try to find the article: A New Technique for Rendering Complex Portals. It describes a better method using the stencil buffer and render-to-texture.

Sorry if this is way of mark for your problem, your OP was unclear.
yes, i understand.

but I'm using adobe director so i don't have these fancy stuff.

I'm posting 2 example links of my engine, one with the frustum portal clipping:
http://alturl.com/hur3

and one without the clipping:
http://alturl.com/cof9

you can move with direction keys and "a", "d" for walking left and right.

can someone tell me how to do the uv clipping right in the old fashion way?

10x
OK, i solved the problem!

I find out that when I'm using objects with quad faces or more,
the texture is bending after the frustum clipping.
But when I'm using models with triangles only,
the texture looks fine after the clipping.

Thanks anyway,
Guy

This topic is closed to new replies.

Advertisement