Nick said:
I'm curious why you have to do this in the first place. If v is known to be in the plane, it was constructed as a linear combination of v1 and v2 in the first place. So instead of working in world xyz coordinates, why not work in the plane's coordinate system instead (ab coordinates)?
Can you reveal anything more about the actual application you need this for?
Can you reveal anything more about the actual application you need this for?
Sure I have nothing to hide, the project behind it is rather stupid and useless, but I got so involved in the maths it made me blind as usual :) A friend of mine got a quadcore so we wanted to brute force ...ehm, test if they REALLY gave us a quadcore :) . We came up with a battery of sub-projects. One of them deals with breaking cyphers based on shift registers, another one deals with analysing data and yet another one we decided should be a software rasterizer, since I have some knowledge on the topic and need one for Silverlight anyway. I remember discussing an idea here with you (Nick et. al.), that I never found the time to test in practice, about how to crudely devide the rasterizer workload on multiple units. Can't find the post now, but it went like this. You write a small rasterizer that fills only an ID-Z-buffer, meaning stores z-values as in a normal z-buffer, but also stores the ID of the polygon covered by that pixel. After you've pushed all geometry through it, you do this:
for each element Element of ID-Z-Buffer {
reverse project (Element.screen_x, Element.screen_y) using Element.z into
point.x,point.y,point.z
get triangle by Triangles[Element.ID]
v1 = triangle.reference_vector1
v2 = triangle.reference_vector2
v3 = triangle.reference_vector3
v = vector formed by point.x, point.y, point.z in the same plane as v1, v2
using the same reference point
// v1, v2, v3 precomputed, orthonormal
//
// now come the funny spot
//
calculate alpha, beta such that v=v1*alpha+v2*beta
//
// OK now comes the even funnier spot I'm not sure about at all :D
//
use alpha & beta with two precomputed vectors on the texture plane
covering the triangle plane to calculate (u1,v1)....(un,vn), the texture
coordinates of of all available textures for this point
use alpha & beta to calculate some other shading
use the available vectors for lighting & stuff
use the shading information to shade the corresponding pixel on screen.
}
Now this is absurd, I know that, it's perfectly clear to me that it's a waste. It's just meant to test the new hardware and we want to put it together fast. Why can we test the hardware with it? Easy, we devide the screen in four almost equal squares and use each core to rasterize a square. It should work in my eyes. The only thing I'm not sure about in the pseudocode above is using alpha and beta to extract (u,v), but it seems ok on paper. As I said, I'm so excited and blind I cannot think straight about other alternatives right now, sure they'll be many.












