x


make one thing flat to another

im working on making a portal style mechanic that works on anything, so i need it to work on any surface, my problem is that if i shoot a portal on a surface thats at a weird angle it just looks off and awkward, how do i get the portal model i've made to be flat against the surface its being shot at?

TLDR : how do i get the portal model ive made to be flat against the surface its being shot at?

more ▼

asked Jun 29 '12 at 08:21 PM

Knightleaf gravatar image

Knightleaf
21 1 2

Reword your question, its hard to get what you are asking. How is it "weird". Need better details.

Jun 29 '12 at 08:31 PM GC1983
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

There is a reason why Valve allows portals only at locations that follow some rules: i.e. flat and big enough ('white' is not a technical reason, that is only a gameplay mechanic)...it is very difficult to make them work on arbitrary surfaces. With flat surfaces it is quite straight forward: all you need is the surface normal (and the center of the 'tile', so the portal doesn't appear at a corner and sticks out of the wall)...from the top of my head I can't think of a mechanic, that would work with curved surfaces...you could try painting the portal on the surface using projectors, and a collider to move the player to the outgoing portal, but that would probably not look or behave like the real deal...

more ▼

answered Jun 29 '12 at 08:35 PM

Piflik gravatar image

Piflik
5.4k 15 26 44

are you saying that valve pre set the angles of the portals that will hit them so that they always look right? i have a few ideas of how to do it but im not sure if they will work 100% :S

Jun 29 '12 at 08:44 PM Knightleaf

Unfortunately, if you have tried Portal, you can actually shoot through the seams between walls. I think they used a variation of their "you can't shoot here" walls to cover up the corners, leaving a tiny gap there that you actually can shoot through.

Jun 29 '12 at 08:46 PM Mizuho

The angle doesn't matter, only that the surface is flat. If you have the surface normal, you can rotate the portal accordingly.

Jun 29 '12 at 08:48 PM Piflik

@Knightleaf: I thought the angle was decided by your character's orientation when they shot the portal? I haven't played in a while, but I thought that was how they did it...

Jun 29 '12 at 08:51 PM Mizuho
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x122
x55
x36
x13

asked: Jun 29 '12 at 08:21 PM

Seen: 281 times

Last Updated: Jun 29 '12 at 08:51 PM