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

## Recommended Posts

[font="Arial,"][size="4"]This is a cross post of mine from Stackoverlfow:

[size="4"]I am trying to cast a shadow with a projection transformation. But it seems that OpenGL doesn't like my matrix as it does not draw anything after glMultMatrix. After I pop my matrix everything's ok. I'm also using JOGL, maybe the problem's with that, but I doubt it since my custom translation and rotation matrices work fine.

[size="4"]The matrix looks like this:

lightPosition = {x, y, z, 1} planeEquation = {a, b, c, d} pl = a*x + b*y + c*z + d a*x-pl b*x c*x d*x a*y b*y-pl c*y d*y a*z b*z c*z-pl d*z a b c d-pl
[size="4"]Now this is a matrix which I calculated, but I also used two other flavors I searched for on the internet; one a bit different, and another which is exactly like mine times -1. Is this enough information? Or should I submit code also?

[size="4"]Maybe it's my plane equation?

three points on plane = p0, p1, p2 v0 = p1 - p0 v1 = p2 - p0 n = {a, b, c} = v0 (cross) v1 d = -(n (dot) p0) planeEquation = {a, b, c, d}
[/font][font="Arial,"][/font][font="Arial,"][size="4"]Does it sound familiar to anyone? Or it's just a code thing?

[size="4"][font="Arial,"]There's this test that I'm trying to do, and that to draw a single vertex point with and without the matrix (for an x-z plane and a {0, 20, 0} spot light), and with an orthogonal projection matrix. Also, I'm trying to calculate myself the normalized device coordinates of that vertex by getting OpenGL's projection and model view matrices and multiplying it with them, and normalizing with the w coordinate.[/font][/font]
[font="Arial,"] [/font]
[font="Arial,"][size="4"]What I get is that without my "shadow matrix" it displays the point nicely and it seems my calculations of the vertex match what I'm seeing. But with my "shadow matrix" I get nothing, although the vertex's coordinates lie within the [-1,1] range on all axes.

[size="4"]This is just too strange...

[/font]

1. 1
2. 2
3. 3
Rutin
18
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633659
• Total Posts
3013216
×