Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Hiding objects from one camera but not another?

Author
Message
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 27th Apr 2007 22:10
How exactly does one hide an object from being seen by one camera but not by another? For example, the player's model.

No matter where you are... everyone is always connected.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 27th Apr 2007 22:21
IIRC this cant be done with a command right now but will be a feature of DBPX10 for Vista.

You can however, just show the object for 1 camera, sync that camera, hide the object, and sync the second camera. That should do the trick, its just a bit of a resource hog.

Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 27th Apr 2007 22:39
I was trying to use sync mask to do exactly what you suggested but the game never got past boot up for some reason.

The player's camera is 0, I want to hide the player's model, which is object 1 from camera 0

Then I have a third person camera, which is camera 1 that displays in a viewport up in the corner of the screen. I want the model to show for that camera.

I'm not sure how to use sync mask properly though

No matter where you are... everyone is always connected.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Apr 2007 02:01
Quote: "The player's camera is 0, I want to hide the player's model, which is object 1 from camera 0"


I might be misunderstanding what you are trying to achieve, but can't you place the player's camera inside object 1 (the player).

With culling, the camera shouldn't see the model.

TDK_Man

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 28th Apr 2007 02:20 Edited at: 28th Apr 2007 02:20
Thats risky TDK, if she has any polygons at all that face the camera (could be an arm, a weapon... even the inner edge of an eye-lid) the camera will pick it up.

Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 28th Apr 2007 02:38
Ruccus is correct. All games I've ever seen go so far as to hide the entire model entirely. If you set the camera front clipping plane so that it obscures the feet when looking straight down, it'll also clip the ground when you'r enot looking straight down. This can be quite disconcerting, to walk on thin air.

I do intend to eventually have the player's body visible, especially when looking down, but that's down the road, when i can get a special model made and adjusted especially for the purpose.

Basically I'm tired of looking down at the ground and seeing nothing. It's not desirable in the least to look down and see through your own body, let alone to get polygons popping up on the screen in all the wrong places just because you jump, or run, or not run.

No matter where you are... everyone is always connected.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 28th Apr 2007 02:48
Lucy, if you're talking about how in an FPS, when you look down you see your body walking, hiding objects isnt how they do it at all.

For one thing, the head and neck aren't there at all. The torso is tilted backwards and sometimes elongated to make for an intersecting field of view. The legs are also tilted back a bit so you can see the feet a bit better. The arms are positioned much higher than they should be, usually around the mouth height.

Kind of like this:



Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 28th Apr 2007 17:12
Yeah, that's why you can see these models being all distorted like that in an FPS when you go into third person right? Oh wait, they don't.

They do actually hide the player's model. I'm sorry, but they do.

What you're telling me is that basically, when you're in first person, you can look down and see the little round shadow on games that do little round shadows. And not see feet or torso or anything. Yet when you go into third person mode, you see the feet directly over this shadow.

The arms are not miraculously placed at the mouth level. The arms are rendered seperately from the rest of the level and are hidden when in third person mode.

Take Quake 1 for instance.

In Quake 1, you have two weapons on the model. Gun and Axe. The gun is the same regardless of which gun you have selected. Even in third person mode.

However, when you're in first person, you see models for shotgun, super shotgun, nail gun, super nail gun, grenade launcher, rocket launcher, lightning gun, and anything that's been added by mod or expansion.

In third person, when the axe is not being used, it's shoved inside the torso. When the gun is not being used, it's also shoved inside the torso.

The Quake model also lacks any frames to miraculously move the gun up to to the mouth height. There are no textures in the model package for weapons other than the generic gun and the axe.

So please, can you provide some evidence about how FPS games work the way you claim they do? Because just a quick look over the GL Quake source code reveals that they do infact hide the player's model while showing it for the camera that looks through the reflections. And yes, there are, or at least were reflections in the original GLQuake, but you had to enable them and they were easily found in the entry way to the easy difficulty hall. Where the red and yellow stained glass window is.

No matter where you are... everyone is always connected.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 28th Apr 2007 19:15 Edited at: 28th Apr 2007 19:18
<nevermind.>

PMS elsewhere please.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Apr 2007 06:19
Going back to the original question, I can't think of any way that an object can be visible in one camera view, but not in another - other than using Ruccus' original suggestion.

I'm not a big FPS game player (I much prefer AOE/C&C style games to be honest) but with the odd ones I have tried, I honestly can't say I've noticed what they actually did with respect to your particular problem. I'm going to have a look at Doom 3 now to see what it does.

I would have suggested positioning the first camera just in front of the eyes instead of inside the head, but when you look down, you'd still see the model - something you don't want.

Wouldn't it be more realistic to look down and see your model's legs and feet rather than just the ground or is there a reason you want the model hidden?

(Actually I might answer my own question when I've checked out Doom 3)!

TDK_Man

Person99
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location: Good question
Posted: 29th Apr 2007 21:44 Edited at: 29th Apr 2007 21:49
Quote: "How exactly does one hide an object from being seen by one camera but not by another? For example, the player's model."


I am assuming you want both a first person cam, and a third person cam?

There really isn't need for a sync mask to do this.

You could try and use variables and the hide object command.
For example (Not actually attempted in DBPro):

If player1firstperson#=0 then show object head#
If player1firstperson#=1 then hide object head#

Most games only hide the head in first person past Quake III.
The head in games like Quake IV and F.E.A.R are an attatchment to the model. If you spawn a replica soldier in F.E.A.R, unless you include HEAD=REPLICA# then you get a headless enemy that trips over himself and shoots like an idiot.

People should not be looking at Doom 3, it may have okay graphics, but it's features are not good.

If you really want the player's full model to be gone, then just do something like this:

If player1firstperson#=0 then show object playermodel001#
If player1firstperson#=1 then hide object playermodel001#

Lets say the cam switch into first person is activated by the control key, and third person is activated by alt (Using the HIDE OBJECT command):

DO

HX#=object position X(HEAD#)
HY#=object position Y(HEAD#)
HZ#=object position Z(HEAD#)

if in_game=1
if controlkey()=1 and dead=0
position camera HX#, HY#, HZ#
hide object HEAD#
endif
if altkey()=1 and dead=0
position camera HX#, HY#+5, HZ#-5
show object HEAD#
endif
endif

Or if you want it to hide the entire player model:

DO

P1X#=object position X(PLAYER1#)
P1Y#=object position Y(PLAYER1#)
P1Z#=object position Z(PLAYER1#)

if in_game=1
if controlkey()=1 and dead=0
position camera P1X#, P1Y#+2, P1Z#
hide object PLAYER1#
endif
if altkey()=1 and dead=0
position camera P1X#, P1Y#+5, P1Z#-5
show object PLAYER1#
endif
endif

The codes may need a little syntax editing.

Do you think that one of these codes would work?

I can edit the codes with comments if you can't understand it.

The Person99 awards go to: 1. Jack the Ripper for hardest crime scenes. 2. Peter Petrelli for most powers. 3. Superman for longest flight. 4. "The Doctor" for best time travel machine.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Apr 2007 01:58 Edited at: 30th Apr 2007 02:13
Person99:

Edit your post, highlight the actual code part and click on the Code button just above the smilies. (Just like using the quote button).

You won't lose the indentation doing that - and it looks much better!

Quote: "People should not be looking at Doom 3, it may have okay graphics, but it's features are not good."


Ah OK. That just happened to be the only FPS I had installed.

And re your example, Lucy is talking about using 2 camera views simultaneously - not switching between two cameras. If you use a variable flag to turn off the model it will disappear from the second camera view too. She wants it to remain in the second camera view, but not the first.

TDK_Man

Login to post a reply

Server time is: 2024-09-25 21:25:44
Your offset time is: 2024-09-25 21:25:44