1 registered members (AndrewAMD),
1,306
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Camera question
#396651
03/08/12 20:25
03/08/12 20:25
|
Joined: Mar 2011
Posts: 69 Munich (Germany)
LPF
OP
Junior Member
|
OP
Junior Member
Joined: Mar 2011
Posts: 69
Munich (Germany)
|
is it possible to tell the engine that it shouldn't render the part of the level that lies beyond a certain layer (like y < 100) i mean to make it possible to see through a wall, that lies between the player and the camera and consits of wed level blocks and some models
..oooO ......... ..(....)..Oooo.. ...\..(...(....).. ....\_)....)../.. ...........(_/... ...ICH WAR.... ........HIER....
|
|
|
Re: Camera question
[Re: LPF]
#396654
03/08/12 20:36
03/08/12 20:36
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
Mhh. Maybe u can create a Map Entity (or model) of the levelpart. Then u could apply a script like this
action _Render_me_or_not()
{
while(!player) wait(1); //wait for player entity
while(1)
{
if (vec_dist(my.x,player.x) < 100) reset(my,INVISIBLE|PASSABLE);
else set(my,INVISIBLE|PASSABLE);
wait(2);
}
}
This would set your levelpart invisible and passable if player is 100 away and show it when player is near. Hope this helps? Edit: If u mean that a wall gets invisible when camera is behind and player is infront, so that u can see the player. This is a bit more complicated. Never done it. Maybe u can make a c_trace from camera pos to see if it hits something. But that would mean, that u need to build your level with models or map entities cause i dont know a command to make blocks invisible. Maybe someone else.
Last edited by rayp; 03/08/12 20:44.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: Camera question
[Re: Espér]
#396709
03/09/12 11:48
03/09/12 11:48
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Here is an example of my variation of Esper's idea... in the flesh... I will post a link to a complete demo of this code shortly...
BMAP* STW_bmap = "#16x16x24";
PANEL* STW_pan = { bmap=STW_bmap; alpha=75; flags = TRANSLUCENT | SHOW; }
VIEW* STW_cam = { bmap=STW_bmap; clip_near=1; flags = SHOW; }
void see_thru_wall_updater()
{
vec_set(STW_cam.x, camera.x); vec_set(STW_cam.pan, camera.pan);
if((STW_bmap.width!=screen_size.x)||(STW_bmap.height!=screen_size.y))
{
STW_pan.bmap=STW_cam.bmap = NULL;
bmap_purge(STW_bmap); bmap_remove(STW_bmap);
STW_bmap = bmap_createblack(screen_size.x, screen_size.y, 24);
STW_pan.bmap = STW_cam.bmap = STW_bmap;
STW_pan.size_x=screen_size.x; STW_pan.size_y=screen_size.y;
}
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Camera question
[Re: EvilSOB]
#396711
03/09/12 12:01
03/09/12 12:01
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK. HERE is a link to the demo. Its pretty crude at the moment, but it shows a promising proof-of-concept. Ive got a few ideas for improvement Ive yet to try, but because Im new to working with VIEWs, I am unable to estimate what sort of horsepower this process is going to require. I havent detected any noticable load, but as you can see, its only a very simple level with only one active entity. Ideas anyone?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Camera question
[Re: EvilSOB]
#396713
03/09/12 12:59
03/09/12 12:59
|
Joined: Mar 2011
Posts: 69 Munich (Germany)
LPF
OP
Junior Member
|
OP
Junior Member
Joined: Mar 2011
Posts: 69
Munich (Germany)
|
am I allowed to use this in my game? i'm actually trying to understand it but i think i need a bit for this... and it works as PERFECT as i whished
Last edited by LPF; 03/09/12 13:30.
..oooO ......... ..(....)..Oooo.. ...\..(...(....).. ....\_)....)../.. ...........(_/... ...ICH WAR.... ........HIER....
|
|
|
Re: Camera question
[Re: LPF]
#396715
03/09/12 13:06
03/09/12 13:06
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hell yeah, I wrote it for YOU as a mental exercise for myself.
If youve got any question about what its doing, or why, just ask here...
[edit] I will probably have further improvements and or suggestions later on, so stay tuned...
At the moment, its a bit ugly... especially the floor being clipped...
Last edited by EvilSOB; 03/09/12 13:08.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Camera question
[Re: EvilSOB]
#396718
03/09/12 13:32
03/09/12 13:32
|
Joined: Mar 2011
Posts: 69 Munich (Germany)
LPF
OP
Junior Member
|
OP
Junior Member
Joined: Mar 2011
Posts: 69
Munich (Germany)
|
not really... it's o.k. like that
if you want i could post the project here...
Last edited by LPF; 03/09/12 13:34.
..oooO ......... ..(....)..Oooo.. ...\..(...(....).. ....\_)....)../.. ...........(_/... ...ICH WAR.... ........HIER....
|
|
|
Re: Camera question
[Re: LPF]
#396719
03/09/12 13:44
03/09/12 13:44
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Nah, its cool dude.
The other ideas for improving it Ive had so far have all been a bust.
So if you're happy, that will do...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|