This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

# cn.Tutorial Effects - Function Printing

Back: Mr. Wiggle
Next: Vertex Data

### f(x, y) = z

```float2 Frequency = 10;
float2 Phase = 0;
float2 Amplitude = 0.01;

vs2ps VS(
float4 PosO  : POSITION,
float4 TexCd : TEXCOORD0)
{
//declare output struct
vs2ps Out;

//calculate two waves
float2 wave = sin(PosO.xy * Frequency + Phase) * Amplitude;

//set z coordinate
PosO.z = wave.x + wave.y;

//transform position
Out.Pos = mul(PosO, tWVP);

//transform texturecoordinates
Out.TexCd = mul(TexCd, tTex);

return Out;
}```

### f(u, v) = xyz

```x = v*cos(u)
y = v*sin(u)
z = v```

```float3 Cone(float2 uv)
{
float u = uv.x;
float v = uv.y;

float3 newPos;
newPos.x = v * cos(u);
newPos.y = v * sin(u);
newPos.z = v;

return newPos;
}```

```#define twopi 6.28318531

float2 Scale = 1;
float2 Offset = 0;

float3 Cone(float2 uv)
{

uv *= Scale;
uv += Offset;

float u = uv.x * twopi;
float v = uv.y;

float3 newPos;
newPos.x = v * cos(u);
newPos.y = v * sin(u);
newPos.z = v;

return newPos;
}

vs2ps VS(
float4 PosO  : POSITION,
float4 TexCd : TEXCOORD0)
{
//declare output struct
vs2ps Out;

//set new position
PosO.xyz = Cone(PosO.xy);

//transform position
Out.Pos = mul(PosO, tWVP);

//transform texturecoordinates
Out.TexCd = mul(TexCd, tTex);

return Out;
}```

Next: Vertex Data
Back: Mr. Wiggle

# Shoutbox

~19h ago

motzi: @udo2013: you can't change the resolution of the standard DX11 renderer (res=window size). use temptarget renderer + preview instead

~23h ago

Tamoeba Kale: Is it possible that i am missing thew whole "animation" category nodes? how?

~2d ago

udo2013: hello. is there a way to change the fullscreen resolution of renderer dx11? found no possibility + can not be opened.

~2d ago

tekcor: @joreg vl.glTF loader looks intense inside, but is red in b36.

~2d ago

MultiNIL: @joreg sure!

~3d ago

joreg: @MultiNIL supa! can we have this as a gallery entry? 24

~3d ago

MultiNIL: forgot to share: our very first vvvv project, digital-hybrid-airhockey-table: https://vimeo.com/210617286 making of: https://vimeo.com/269974764

~3d ago

dawoof: looking for a VJ/performer for the 1st of june for 1 hour in Amsterdam for a Conference, Hit me up +649241940

~3d ago

tekcor: @joreg cool seems like i missed that one. such a good shader resource

~4d ago

karistouf: does anyone has trouble with the new update of windows ? switching to other app while rendering fullscreen provoks blank output