I am making an attempt to render a cone on the gpu for some results. I am utilizing the parametric equation supplied right here. I ended up with the shader under meant to work with an unorderedaccessview goal (DX11). I am blocked within the rotating impact I need to have, the cone appears to rotate but it surely stays flat on the display screen proven within the above image.
Within the shader the rotation is utilized to the route D and to the 2 vectors U and V defining the aircraft of the circle. Possibly these U and V vectors are usually not right or it’s my calculs for the rotation. The rotation is within the matrix world (rotation within the y axis solely).
What does completely not work is once I apply the complete transformation to the calculated cone level within the "a" loop. The calcul I exploit is about as remark.
[numthreads(32,32,1)]
void CS_PostDeferred( uint3 nGid : SV_GroupID, uint3 nDTid : SV_DispatchThreadID, uint3 nGTid : SV_GroupThreadID )
{
float2 Tex = float2(nDTid.x/SM_SCREENX, nDTid.y/SM_SCREENY);
//this can be a brut power shader for take a look at. The cone is displayed solely at level display screen(0.25,0.25)
if ((Tex.x>0.249)&&(Tex.x<0.25))
if ((Tex.y>0.2475)&&(Tex.y<0.25))
{
matrix M = World*ViewProjection;//cannot work with but. see under
float3 O = float3(0,0,0);//prime of cone
float R = 200;//radius of cone on the base
float H = 255;//peak of cone
float3 D = float3(0,0,1);//route of the cone
float3 U = float3(0,1,0);//vector within the aircraft of the cone circle if cone oriented in z axis
float3 V = float3(1,0,0);//vector within the aircraft of the cone circle if cone oriented in z axis
//some rotation at the beginning whitout rotating the pixel place
//offers some efficient rotation however the cone shouldn't be appropriately rotating
D = normalize(mul( D, (float3x3)World ));
U = normalize(mul( U, (float3x3)World ));
V = normalize(mul( V, (float3x3)World ));
float3 P;
uint h;//present place alongside the entire peak H
for ( h = 0; h< H; h++)
{
float hH = h/H;
float RhH = R * hH;
uint a;//angle used to attract the circle at peak h
for ( a = 0; a < 72; a++ )//make a circle at peak h
(XY.y<<8)
}
}
}