Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 635 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Mirror problem #141475
07/16/07 22:34
07/16/07 22:34
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Ok this is the pic of the mirror I am trying to do.


As you can see the bottom of the mirror is not reflecting

here is the code from fx01.wdl with my changes.

Code:
  VIEW fxa_mirror_view { };

// action: FXA_Mirror
// title: Mirror
// Desc: Create a floor mirror.
// Code to simulate a floor mirror by generating
// a vertically flipped camera view from below through the floor
action horz_Mirror
{
// initialize camera portal for realtime reflections
ifdef CAPS_MIRROR;
camera.portal = fxa_mirror_view;
fxa_mirror_view.noshadow = on; // suppress shadows in the mirror
fxa_mirror_view.portalclip = on; // clip at portal plane
while(1)
{
proc_late(); // place it at the end of the function list - the camera must be moved before
fxa_mirror_view.genius = camera.genius;
fxa_mirror_view.aspect = -camera.aspect; // flip the image upside down
fxa_mirror_view.arc = camera.arc;
fxa_mirror_view.fog = camera.fog;
fxa_mirror_view.fog_start = camera.fog_start;
fxa_mirror_view.fog_end = camera.fog_end;
fxa_mirror_view.x = camera.x;
fxa_mirror_view.y = camera.y;
fxa_mirror_view.z = 2*camera.portal_z-camera.z; // move the camera at its mirror position
fxa_mirror_view.pan = camera.pan;
fxa_mirror_view.tilt = -camera.tilt; // flip the vertical camera angle
fxa_mirror_view.roll = -camera.roll;
wait(1);
}
endif;
return;
}

action vert_mirror
{
ifdef CAPS_MIRROR;
camera.portal = fxa_mirror_view;
fxa_mirror_view.noshadow = on; // suppress shadows in the mirror
fxa_mirror_view.portalclip = on; // clip at portal plane
while (1)
{
proc_late(); // place it at the end of the function list
fxa_mirror_view.genius = camera.genius;
fxa_mirror_view.aspect = camera.aspect;
fxa_mirror_view.arc = -camera.arc;
fxa_mirror_view.fog = camera.fog;
fxa_mirror_view.x = camera.x;
fxa_mirror_view.y = 2*camera.portal_y - camera.y;
fxa_mirror_view.z = camera.z
;
fxa_mirror_view.pan = -camera.pan;
fxa_mirror_view.tilt = camera.tilt;
fxa_mirror_view.roll = camera.roll;
wait(1);
}
endif;
return;
}



Anybody know what I may have done wrong here.

I've tried changing and adding a the .y values but to no avail.

I have the surface on the mirror.wmb set to flat and the portal block set to invisable etc..

please help.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: Mirror problem [Re: Nidhogg] #141476
07/17/07 06:18
07/17/07 06:18
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Can you please comment out the line:

"fxa_mirror_view.portalclip = on; // clip at portal plane"

and telling me what happens?

cheers

Re: Mirror problem [Re: zwecklos] #141477
07/17/07 09:16
07/17/07 09:16
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Ok did what you suggested and this is the result


It worked but still no reflection of player..

Getting there

thanks


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: Mirror problem [Re: Nidhogg] #141478
07/17/07 09:45
07/17/07 09:45
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
hmmm Im not sure why your player is not going to show off in the rendered view.
Maybe its related to your 1st_person camera settings or have you tried to use something like this?

"fxa_mirror_view.genius = player .genius;"

I hope this helps...

cheers

Re: Mirror problem [Re: zwecklos] #141479
07/17/07 12:01
07/17/07 12:01
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Ok I found tis line in the new camera1stPerson01.wdl...
if(cameraTarget_ent != NULL) { cameraTarget_ent.invisible = on; }

Shouldn't the above be
if(cameraTarget_ent != NULL) { cameraTarget_ent.invisible = off; }

Thanks


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: Mirror problem [Re: Nidhogg] #141480
07/17/07 12:40
07/17/07 12:40
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Try to add this 2 lines:

vec_set(mirror.portal_y,vector(0,my.y + my.max_y,0));
vec_set(mirror.pnormal_y,vector(0,-1.0,0));

add em before you make your mirror-view visible.

Im not sure if this code works, I dont have the posibility to test it out and so far Ive never done a vertical mirroring
Also Im not sure if this is going to fix your issue with your not-mirrored player.

cheers

Last edited by zwecklos; 07/17/07 12:43.
Re: Mirror problem [Re: zwecklos] #141481
07/17/07 18:08
07/17/07 18:08
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
portal_x & pnormal_x should already be set by the engine if your using a block as the mirror surface. If our using a model, then you can easily set these like so:

view.portalClip = on;

vec_set(view.portal_x, my.x);
vec_for_angle(temp, my.pan);
vec_set(view.pnormal_x, temp);


portalclip should always be used, as this is how the view knows where to start rendering/clip. Then you should be able to set the view's position:

var angle[3];
vec_for_angle(angle, view.pnormal_x);
vec_diff(temp, camera.x, view.portal_x);
vec_rotate(temp, vector(0, 180, 0));
vec_add(temp, view.portl_x);
vec_set(view.x, temp);
vec_diff(temp, camera.pan, angle);
vec_inverse(temp); // may need to be changed
vec_set(view.pan, angle);
ang_rotate(view.pan, temp);


I don't even know if this wil all work. Maybe it'll be useful to somebody...


xXxGuitar511
- Programmer
Re: Mirror problem [Re: xXxGuitar511] #141482
07/18/07 05:53
07/18/07 05:53
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Thanks xXxGuitar511.
I anyway wanted to test out mirroring on models with a target_bmp.
Your suggestions are great as usual.

cheers

Re: Mirror problem [Re: zwecklos] #141483
07/18/07 07:33
07/18/07 07:33
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Ditto, thanks xXxGuitar511. I will try that code if I can't get this block mirror working properly using conitec's templates. Why they supply buggy templates with a great game developers progis beyond me.

Anyway, I've tieded up the mirror a bit and it's looking good now.
Still have a few bugs though,

1st is - I still can't gt the player to show up in 1stplayer camera mode


Now this is the 3rd person camera view


So the problem has to do with the Camera1stPerson01.wdl.

I cannot find the problem myself - Being a begineer and all.

So maybe someone can look at that template and fix the default code so it works
please.

Also have this problem as well,



Nasty shadowing on the edges.

As I stated, I am using the block method, So maybe doing it that way is not
a good idea. I also noticed that in the manual it states that the mirror tag
is obsolete. Yet I have to use it to get the mirror to work.
Another conitec error.

My full code can be downloaded here
http://www.mythical-zone.net/gsstuff/Niteclub.rar

If anybody has anyluck please please post the fix back here.

Many Many thanks...


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: Mirror problem [Re: Nidhogg] #141484
07/18/07 09:32
07/18/07 09:32
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline OP
Serious User
Nidhogg  Offline OP
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Cool, I think I have fixed my mirror prob but know I have a prob with the 1stperson camera clipping into the player. When I switch to 3rdprson view and back again the problem is gone though.


Anyone?

Last edited by Nidhogg; 07/18/07 09:38.

Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1