 	vec3 vert_polar = cartesian_to_polar(vertex_modelspace);
 	
 	//vec3 vert_dtheta = polar_to_cartesian(vert_polar + vec3(0, step, 0));
-	vec3 vert_dtheta = vec3(rotate(dvec3(0, 1, 0)) * vertex_modelspace);
+	vec3 vert_dtheta = vec3(rotate(vec3(0, 1, 0)) * vertex_modelspace);
 	float height_dtheta = get_height(vert_dtheta);
 
 	//vec3 vert_dphi = polar_to_cartesian(vert_polar + vec3(0, 0, step));

	return cart;
}

dvec4 rot_quart(dvec3 axis) {
	dvec4 q = dvec4(0);
	q.x = axis.x * sinx;
	q.y = axis.y * sinx;
	q.z = axis.z * sinx;

	return q;
}

mat3 rotate(vec3 axis) {
	vec4 q = rot_quart(normalize(axis));
	mat3 rot;
	rot[0] = vec3(1 - 2 * (q.y*q.y + q.z*q.z), 
				   2 * (q.x*q.y - q.z*q.w), 
				   2 * (q.x*q.z + q.y*q.w));
	rot[1] = vec3(2 * (q.x*q.y + q.z*q.w), 
				   1 - 2 * (q.x*q.x + q.z*q.z),
				   2 * (q.y*q.z - q.x*q.w));
	rot[2] = vec3(2 * (q.x*q.z - q.y*q.w),
				   2 * (q.y*q.z + q.x*q.w), 
				   1 - 2 * (q.x*q.x + q.y*q.y));
	return rot;
}

mat3 rot90(vec3 axis) {
	vec4 q = vec4(axis, 0);
	mat3 rot;
	rot[0] = vec3(1 - 2 * q.y*q.y - 2 * q.z*q.z, 2 * q.x*q.y - 2 * q.z*q.w, 2 * q.x*q.z + 2 * q.y*q.w);
	rot[1] = vec3(2 * q.x*q.y + 2 * q.z*q.w, 1 - 2 * q.x*q.x - 2 * q.z*q.z, 2 * q.y*q.z - 2 * q.x*q.w);
	rot[2] = vec3(2 * q.x*q.z - 2 * q.y*q.w, 2 * q.y*q.z + 2 * q.x*q.w, 1 - 2 * q.x*q.x - 2 * q.y*q.y);
	return rot;
}

