# knighty

Member

198

313 Neutral

• Rank
Member
1. ## Position from Depth

You are right. Sorry, I haven't read the last reply of Endemoniada and found it quite strange that FarZ is hardcoded in the shader.
2. ## Position from Depth

If you divide your linear depth by FarZ, why don't you multiply the reconstructed depth by the same value?
3. ## Projection matrix question

What about: Vec4 vecVS(0, 0, -10, 1); Vec4 vecProj = projMat * vecVS ; //Or someting like : vecProj = vecVS * transpose(projMat) ?
4. ## Equation of a Square?

It also have parametric representations: - Square: x=infcos(t); y=infsin(t); (infPI=4) -Diamond: x=abscos(t); y=abssin(t); (absPI=2*sqrt(2)) where:sawtooth(x){ abs((x-4*floor(0.25*x))-2)-1 } infcos(x){ min(1,max(-1,sawtooth(0.5*x)*2)) } infsin(x){ infcos(x-2) } abscos(x){ x*=sqrt(2)*0.5; sawtooth(x) } abssin(x){ x*=sqrt(2)*0.5; sawtooth(x-1) }
5. ## Sound triangulation using Apollonius?

Shouldn't it be?: |P-A|-|P-B|=t[sub]AB[/sub]
6. ## Calculus Help!

Actually, you don't need[font="Arial"] l'Hôpital's rule[/font]. Just simplify the expressions in order to remove the denominator.
7. ## GLSL Droste

Hi, Here is the link to an Excellent pixel bender implementation of this effect. pixel bender language is not GLSL but it's very close. Hope you'll find it useful.
8. ## Bilateral Filtering

Quote:Original post by Tipotas688 Hmm I am still a bit confused with the whole kernel business How big should be the kernel? 3x3? The whole image? My preference? Your preference:) It depends on the results you want to achieve. Quote:Original post by Tipotas688Which center should I use, for example in simple blur i ll use the average of the surrounding pixels in order to calculate the center pixel's value then move to the next one. How do I go about for this one? The same way, only the weights change. They don't depend only on the ralative position in image space but also the relative position in color space (and/or depth ...etc. why not?). good documentation about bilateral filtering.
9. ## Ray generation with rotated camera...

That's what I thought. Your Field of view is too large. with the values you gave the field of view is (in left-right direction): 2*arctan(PixelWidth*ResWidth/2/CamLength)=2*arctan(0.001*1600/2/0.1)=165.75° which is very large. If You set a variable FOV as the field of view angle, CamLength should be (If I did the math correctly): CamLength = PixelWidth * ResWidth / 2 / tan( FOV / 2 ) For an FOV=90° it gives: CamLength = 0.8
10. ## Ray generation with rotated camera...

Maybe it's because the camera position is too close to the view plane, so your field of view is very large. What are the values of PixelWidth, PixelHeight and CamLength?
11. ## sphere projection question

Quote:Original post by apatriarca I think this is a special case regardless of the method used to get the bounding box. Exactly! but the in this case, the special cases are the "trickiest" part as Eric Lengyel's excellent article shows. In the method with angles, even if we use many trigonometric function, the special cases are simpler. That's why I've preferred giving it :)
12. ## Keep point within circular area

What your code does is: -update mouse position. -correct mouse position if it is ouside the circle. The problem resides in the correction part. If the updated position is outside the circle, the corrected position should be the orthogonal projection of the updated position on the circle. This way, it will move on the circle rather than being frozen on its last position. mouseMoveAddition.x += Input.GetAxis("Mouse X") * sensitivityX; mouseMoveAddition.y += Input.GetAxis("Mouse Y") * sensitivityY; float r2 = Math.Pow((mouseMoveAddition.x - 0), 2) + Math.Pow((mouseMoveAddition.y - 0), 2); if (r2 > Math.Pow((crosshairRange.x), 2)) { float ir = crosshairRange.x/Math.Sqrt(r2); mouseMoveAddition.x *= ir; mouseMoveAddition.y *= ir; }
13. ## sphere projection question

Because if the sphere is partially behind the camera it will be transformed by the perspective matrix into an hyperboloid.
14. ## sphere projection question

Hi, That's conceptually much more beautiful than te method I gave. I'm having trouble understanding this:Quote:Original post by apatriarca uT (P-T T-T D T-1 P-1)-T u = 0, uT (PT TT D-T T P) u = 0, Shouldn't it be: uT (P-T T-T D T-1 P-1)-T u = 0, uT ((P-T T-T D T-1 P-1)T )-1 u = 0, uT (P-T T-T DT T-1 P-1 )-1 u = 0, uT ( P T D-T TT PT) u = 0 ? I must add that -in the method you gave- one have to check if the sphere intersects the plane z=0 (in view space) because in this case the projection of the sphere on the screen would appear outside the bounding rectangle found i.e. that bounding rectangle should be clipped somehow. [smile] Edit: corrected a typo [Edited by - knighty on October 24, 2010 1:03:03 PM]
15. ## sphere projection question

Quote:Original post by NiGoea Anyway, I'm having troubles with the math :( Things would appear simpler if you look at the angles. Let us measure the angles from the vertical axis. Let: 1) alpha: the angle(s) between the vertical axis and the lines that are tangent to the circle. 2) beta: the angle between the vertical axis and the line through the center of the circle. 3) theta: the angle between the line tangent to the circle and the one that goes through the center of that circle. We have two possibilities (in reality 3: if the circle contains the origin (the eye) there are no solutions): 1) alpha = beta + theta 2) alpha = beta - theta Now, what are beta and theta? Let c:(c_h,c_v) the center of the circle and r its radius. c_h: coordinate on the horizontal axis and c_v: coordinate on the vertical axis. theta = arcsin(r/||c||) = arcsin(r/sqrt(c_h*c_h + c_v*c_v)) beta=arctg(c_h/c_v)//better use atan2(c_h,c_v) We can notice that if r>||c|| there are no solutions because the viewpoint is inside the circle.