How to make a Portal Gun

 by chiok
Contest WinnerFeatured

Step 3: The main barrel

It all starts with the barrel of the device. This measures up to a cylindrical tube 75mm outer diameter and about 300mm long. A decent bit of wall thickness helps for stiffness but isn't critical. Home drainpipes are just around the right size if you can get some. I didn't want to spend the money so had to use a toy plastic tube which I had to thicken up with several layers of newspaper and glue plastered on. I also mixed some black paint into the glue to save some painting effort later.

Everything is then built onto this barrel, starting at the front. Cut out a suitable sized piece of foam and hot glue it around the barrel to build up the shape. I used an old exercise mat about 8mm thick which was easy to cut with a scalpel but also meant it damaged easily and deforms if in contact with the glue gun nozzle, so be careful! Shaping the front piece of foam is done carefully with a scalpel, it'll get tidied up later.
 
Remove these adsRemove these ads by Signing Up
rashie123 says: Jun 7, 2011. 10:19 AM
Awesome!!!!!
xXnocturnusXx says: Dec 1, 2009. 8:47 PM
wait...so the end of the barrel is foam?...thats kinda lame, would it be possible to harden it by covering it with wood filler...or fiberglass resin (i have a lot of that)?
xXnocturnusXx in reply to xXnocturnusXxDec 1, 2009. 9:34 PM
never mind, im going to get a biger piece of pvc pipe and slide it over the front of the barrel in two diferent sections and sand the front one in a slope, to replace the foam at the front...
peach_fart says: Sep 27, 2008. 6:54 PM
dude the barrel is oval shaped, hence the oval shaped portals
REA in reply to peach_fartNov 21, 2009. 8:29 PM
i have gmod and portal. its definitly round. try to prove me wrong.
38476384723.png
Marche in reply to peach_fartOct 1, 2008. 5:22 PM
Open the source SDK and open the portal gun model in hlmv and come back. I'm pretty sure it's round because it would take extra work to make to make the cylinder the barrel it's based on an ovoid. But in the game code itself the portal is just a oval shaped render-target camera pointed to the other side and the border is just a sprite with some particles drawn around it. The shape does not rely on the model, If you are crafty enough you can switch out the portal gun model for the Half Life 2 Pistol and it wouldn't make a difference since Portal and Half Life 2 run on the same engine. In code the weapons are very flexible to avoid errors. I'm a bit of a Source Engine freak. I Practically live in the Source Engine's API.
peach_fart in reply to MarcheOct 3, 2008. 3:36 PM
i looked at a pepakura file ripped from the game and it was an oval. you can check the barrel with pepakura.
chiok (author) in reply to peach_fartOct 3, 2008. 4:42 PM
Now I will admit, that is one cool Pepakura file there. Wouldn't wanna make it though, looks damn fiddly. Does look a tad oval though, not nearly as oval as the portals, but a bit I will accept.
Marche in reply to chiokOct 4, 2008. 10:17 AM
http://i299.photobucket.com/albums/mm293/Marche96/untitled3.jpg
That is WAY better than converting it into a third party 3d program.
I don't own portal so could you take a screenshot of the barrel for me?
peach_fart in reply to MarcheDec 26, 2008. 9:18 AM
i saw my avatar in that pic.
poletovision in reply to MarcheOct 2, 2008. 8:36 AM
Why don't you just look at yourself in a portal? No one else has noticed the mirror effect you get when you put 2 portals right next to each other? You look face one, and just look at the other and it's a front image of yourself.
Default117 in reply to poletovisionDec 17, 2008. 6:31 PM
There is a cheat code where you can put the portals on top of each other. It makes a mirror and you can see yourself (and the gun).
Default117 in reply to Default117Dec 17, 2008. 6:35 PM
If you listen to the commentaries they tell you why. It's because what you see in the portal is actually a virtual camera in the other one(yes I listened to them).
peach_fart in reply to Default117Dec 26, 2008. 9:19 AM
wtf?!?!? it happened again! i got someone elses comment in my email! whats going on?
Default117 in reply to peach_fartDec 27, 2008. 1:02 PM
Eh?
peach_fart in reply to Default117Dec 27, 2008. 7:04 PM
comments people make to other people keep in popping up in my email its stupid.
chiok (author) in reply to peach_fartDec 28, 2008. 3:14 AM
If someone makes a comment in your "thread" of conversation, you will receive a notification if you opt to have one for new comments. Your comment on 27/11/08 is the first in this thread, so any replies in it go to your email. You could turn the notifications off, but then you won't know when someone replies to you.
peach_fart in reply to chiokDec 28, 2008. 2:13 PM
i mean like someone called person replies to someone called someone i sometimes get that in my email.
peach_fart in reply to chiokDec 28, 2008. 12:33 PM
27/11/08? theres more than 12 months in a year?
Default117 in reply to peach_fartDec 30, 2008. 12:45 PM
Not everyone goes by the mm/dd/yy.
peach_fart in reply to Default117Dec 30, 2008. 12:59 PM
it was a joke.
Default117 in reply to peach_fartDec 30, 2008. 8:06 PM
Oh...well...then...haha. Good one! :D
Default117 in reply to peach_fartDec 27, 2008. 10:36 PM
Haha :P
boegen2 in reply to poletovisionOct 7, 2008. 11:43 AM
garys mod?! cant you spawn such thing in GM?!
peach_fart in reply to boegen2Dec 30, 2008. 1:00 PM
yes. you can spawn props, entities, weapons and npcs in gmod.
Marche in reply to poletovisionOct 2, 2008. 11:37 AM
Yes, render target camera is basically a camera and monitor.. If you open up the Source SDK in steam then go to the model viewer you can look at the model up close like the modeling program used to create the model.
chiok (author) in reply to MarcheOct 2, 2008. 4:39 AM
An interesting idea. All the images I have suggest a circular cross section but the only thing I have which shows the front is an animated gif from the game which shows a circular front barrel. It all goes oval after that though.
Marche in reply to chiokOct 2, 2008. 11:45 AM
Look at my above post. I'm just posting this so you get the email to look at it. I don't own portal but it's a hell of a lot more work to turn a cylinder into a oval type thing and have it make sense or look even. Valve wouldn't do anymore than what's necessary. in HL2 or Portal open up the console and chanve the cheats CVAR on with this: "sv_cheats 1" Then aim at the ground and type "prop_physics_create models/weapons/v_crossbow.mdl" And see the result.
peach_fart in reply to MarcheOct 3, 2008. 3:41 PM
its the crossbow that you hold. everything is there except the other side and your arms stop at your elbows. i looked at this in garrys mod by spawning in the hl or hl2 weapons folders. click on browse and look through.
Marche in reply to peach_fartOct 4, 2008. 10:19 AM
There is no point in making the engine render something you can't see. That's the main reason we don't have a Gordan Freeman model.
peach_fart in reply to MarcheDec 26, 2008. 9:21 AM
Gordan FREEman!
bounty1012 in reply to peach_fartOct 1, 2008. 4:59 PM
actually I think its round too. Its propably a ball of energy when it comes out and it spreads on the wall hence the oval shaped portals.
peach_fart in reply to bounty1012Oct 3, 2008. 3:38 PM
that would make circle portals
bounty1012 in reply to peach_fartOct 3, 2008. 8:48 PM
"...It spreads on the wall hence the oval shaped portals"
peach_fart in reply to bounty1012Oct 4, 2008. 12:20 AM
drip some water on paper and it will make a circle. and anyway, its just a game.
Xerillum in reply to peach_fartDec 9, 2009. 3:15 PM
It's still a physics-based game, and real physics should be applicable to it.
bounty1012 in reply to peach_fartOct 4, 2008. 2:41 PM
I agree it is just a game I dont know why people camp out in front of best buy to buy these games... but If you drop water on a piece of paper it will shape itself like an oval after it spreads.
Marche in reply to bounty1012Oct 5, 2008. 11:11 AM
I can make it into a dragon for all that matters. There is no restriction on shape in the code itself. They made it oval purposely
demonicgod says: Mar 28, 2009. 5:14 PM
SHUT UP!!! GOD!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!