No warning before shooting, Vic court told

A burglar has told of hearing the crack of a rifle and turning to see a hole in the forehead of his accomplice as they tried to rob a Melbourne factory.

Ivan Joe D'Angelo fired on the men as they stood with boltcutters at the gate of his Melbourne factory.

Prosecutors say D'Angelo lined up one of the burglars, Wade Vandenberg, in the scope of his rifle and shot to kill.

But defence barrister Peter Farris QC told D'Angelo's Victorian Supreme Court trial on Friday it was an unintentional killing.

"He sticks the gun out the window, the gun waves around outside the window, the gun goes off and tragically it hits the man in the forehead," Mr Farris said.

D'Angelo, 39, has pleaded not guilty to murdering Mr Vandenberg.

He was living in the loft of his Thomastown panel beating factory when three men arrived to steal his car around 2am on March 3, 2013.

He told police he panicked, grabbed his gun and screamed out at the men from a factory window before the shot was fired.

One of the burglars with Vandenberg told the court he did not hear any shouting from the factory and that he would have fled if he had.

"I just heard a big bang," he said.

"I turned around and looked at Wade, he had a hole in his head and blood was just pouring out."

The burglar, who cannot be identified, said he caught Mr Vandenberg as his knees buckled.

"It took a second or two to realise what really happened," he said.

"There was nothing we could've done ... so I just took off."

Mr Farris told the jury D'Angelo had been drinking alcohol and smoking marijuana when he spotted the burglars at the gate in the dead of the night.

"Mr D'Angelo was very, very frightened," he said.

"He wants these people to go away and he's holding the gun to try and frighten them."

The trial continues.