basic octree

I have been given a project recently which involoves basic graphics and uses an octree method of subdivision. I have done plenty of research on octree and understand how it works but I can not program octree graphics myself! Every time I look for sample code all i find is very confusing code used for computer games which is still a little beyond me! Is there anyway i can look at code of simple cube broken down to smaller cubes in an octree style. I am doing the project in c++ and am struggling to come up with any coding which gives me this octree partitioning.
Can anyone help me?..please

Hm, i’m not sure that your question correspond at the beginners forum level, try out to advanced forum

Even better, go to the maths & algos section.