Please see my last comment to the question, starting with "Sure, I understand that". The request is vague enough (what graphics framework/API are you using?), but what you need is this:
http://en.wikipedia.org/wiki/Recursion[
^],
http://en.wikipedia.org/wiki/Recursion_%28computer_science%29[
^].
Interestingly, such constructions often (but not always), lead to
fractals, geometric objects with non-integer (or even non-existing, in case of so called
non-uniform fractals)
Hausdorff dimension. Such objects can even model many existing object found in real life, which manifest really exotic physical properties, especially in optics and solid-state physics.
Please see:
http://en.wikipedia.org/wiki/Fractal[
^],
http://en.wikipedia.org/wiki/Hausdorff_dimension[
^],
http://en.wikipedia.org/wiki/Fractal_dimension[
^].
This is really a case when you get a chance (and should use it, if you are a good student) to go beyond your narrow ("profession"), even if it so broad as "software" and get some fundamental background, in particular, in mathematics and physics. Use this change!
—SA