Paulo Henrique Machado has lived almost his entire life in hospital. As a baby he suffered infantile paralysis brought on by polio, and he is still hooked up to an artificial respirator 24 hours a day. But despite this, he has trained as a computer animator and is now creating a television series about his life.

The Brazilian's first memories are of exploring the hospital he has lived in for 45 years by wheelchair.

"I explored up and down the corridors, going into the rooms of other children that were here - that is how I discovered my 'universe'," he says.

"For me, playing football or with normal toys wasn't an option, so it was more about using my imagination."

Machado's mother died when he was two days old, and as a baby he contracted polio - the result of one of the last big outbreaks of the disease in Brazil.

Image caption The children on the 'polio ward' in the Clinicas Hospital

In the 1970s, children with polio were encased in a "torpedo" - a body-encasing iron lung - and doctors at the hospital gave grim assessments of the children's prospects. Few in the "polio ward" of Sao Paulo's Clinicas hospital were expected to reach adolescence. Their life expectancy was just 10 years.

Polio: the facts A highly infectious viral disease that mainly affects children under five

Can cause irreversible paralysis

There is no cure, but polio vaccine given multiple times can protect a child for life

Afghanistan, Nigeria and Pakistan are the only countries left with endemic polio

"It was very sad to see all those children, all lying there immobilised in their beds, or with very little movement," says Machado's nursing assistant, Ligia Marcia Fizeto, who began working in the hospital shortly after he arrived.

With very limited mobility, Machado's world formed around the friends he made on the ward.

"There was me, Eliana, Pedrinho, Anderson, Claudia, Luciana and Tania. They were here for a good length of time too, more than 10 years," he says.

With the innocence of childhood, he never imagined that they would be parted. But by 1992, some of the children had begun to deteriorate - one by one, his friends began to die.

"It was difficult," says Machado. "Each loss was like a dismembering, you know, physical… like a mutilation," he says. "Now, there's just two of us left - me and Eliana."

Image caption Machado and Zagui (L) have grown up together

Doctors don't quite understand why the pair outlived their peers by so long, but now every day in the ward, Machado wakes up with his bed facing that of his remaining friend and lifelong neighbour, Eliana Zagui. He says their relationship is crucial. "Some people think we are like husband and wife, but we are more like brother and sister," he says.

I opened the car door and saw the sea and thought 'Wow! What is this! Paulo Machado

"Every day, when I wake up I have the certainty that my strength is over there - Eliana. And it's reciprocated. I trust her and she trusts me."

Despite this the two fight virtually every day, Machado says with a laugh. "I think that's normal between brother and sisters or a couple. But it's not an argument where one side feels offended, you end up reflecting and think, 'OK, I forgive you'," he says.

The danger of infection means that they have to live in hospital. Trips outside are rare but memorable, says Machado, who estimates that he has been outside of the hospital at least 50 times in total, more in recent years. Advances in medical technology mean that going out involves less heavy equipment and less medical supervision - and as they have got older, Zagui and Machado are prepared to take more risks.

Image caption Machado and Zagui at the beach

"There are some [trips] which stand out, like seeing the beach for the first time when I was 32. "I opened the car door and saw the sea and thought 'Wow! What is this!" he says.

It was Eliana Zagui's first time to visit the beach too. "I knew the beach only from photos, films, postcards, stories from other people - so I had built up an image in my mind of what the sea and the beach would be like," she recalls. "They took us out of the vehicles, Paulo was in a wheelchair and they pushed my bed on to the sand."

She remembers feeling the sea water with her hands for the first time. "You enjoy these little moments, that many people take for granted. They don't stop to marvel like we do," she says.

In the ward, Zagui fills her time writing - she is a published author - and painting using her mouth.

Because the pair have been living in the hospital for so long, they are allowed to decorate their room with their own possessions. Zagui's side is filled with dolls and books - and being a confirmed cinephile, Machado's is full of film memorabilia. He also has two powerful computers, as he has been able to train in hospital as a computer animator.

In May this year he reached his target - $65,000 (£44,000) - in an online campaign to raise finance for a 3D animated film series called The Adventures of Leca and her Friends, based on a book that Zagui wrote, which he will direct.

The animation will feature a stop-motion technique, similar to that used by Aardman animations in films such as Wallace and Gromit.

Machado wanted to portray his life with Zagui - also known as Leca - and their friends. "I wanted to make it attractive, not just colourful but full of the mischievous games that kids get up to. I think my characters are realistic, because they come from someone who is disabled. I know [exactly] what the difficulties they face are," he says.