quote:
A spherical mesh with a funky texture on it. Make it dynamic, and when hit, modify the alpha values on the vertices to be opaque-ish near where it's hit, and then fade off. Stronger hits would wrap more than tiny ones. Of course this might be overkill, but it'd look cool.
I have this solution implemented, but it is not quite working the way I would have expected. So far I have a target being enveloped by a sphere; and the D3DXVec3Dot product is being calculated for the vertices using the normalized laser vector and the each of the vertex normal. Using the output of the D3DXVec3Dot product I am able to calculate and set an opaque-ish color and alpha values where the laser hits the target, and then fade off. That said; I have two remaining problems to solve:
1) When the sphere that is enveloping the target is rotated, you can that there are actually two impact points being generated. The first point is at 0 degrees and the second is at 180 degrees. I have tried using the absolute values of the vectors to eliminate the second impact point with little no success thus far.
2) The target in the center of the sphere is not visible unless I render the target before the sphere or turn off the z-buffer? Maybe this is normal; or I could have something wrong with the alpha blending and alpha testing?
(Edit: It would seem that as long as the target is render prior to the sphere; and the sphere is rendered with D3DRS_ZENABLE state set to false then you are able to see the target properly through the sphere. Does it have to be this way?)
Any advice would be much appreciated.
// Phaser vector.D3DXVec3Normalize(&vecDotSource, &vecDotSource);// Vertice Normal.vecNormal = D3DXVECTOR3(vertices[count].fNormalX, vertices[count].fNormalY, vertices[count].fNormalZ);D3DXVec3Normalize(&vecNormal, &vecNormal);// Output used to set the color and the alpha of the vertex.fDotOutput = (float) D3DXVec3Dot(&vecDotSource, &vecNormal);
Understanding is a three edged sword...
[edited by - Sean Doherty on October 18, 2003 6:40:26 PM]