3d example code