Hi VoidGoat,
what type of cylinder shape? As viewed from above a cylinder looks exactly like a circle (or sphere), and from the side a cylinder looks like a rectangle. From other angles a cylinder looks like an ellipse with a rectangle in the middle.
You could actually use the distance field shape for a cylinder if you want. That said there is probably a far easier method if you give some more info.
float sdCappedCylinder( vec3 p, vec2 h )
{
vec2 d = abs(vec2(length(p.xz),p.y)) - h;
return min(max(d.x,d.y),0.0) + length(max(d,0.0));
}
p would be worldposition. by first rotating or transform worldposition you could rotate the cylinder and scale it by scaling worldposition.
The shape you get from the cylinder would depend on how you sample it, ie offsetting from 0 would be like getting different cross sections in 2d.