Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
vertical mirror help.... #333347
07/15/10 21:00
07/15/10 21:00
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
ok guys... i found this script for a vertical mirror. how do i use it? how do you turn this into an action for a entity? i use c-script btw.
Code:
VIEW* mirror = 
{
       layer = 10;
} 

function mirror_startup() 
{ 
       while (!player) {wait (1);}
       camera.portal = mirror; 
       set (mirror, NOSHADOW); // suppress shadows in the mirror 
       set (mirror, NOPARTICLE); // suppress particles in the mirror 
       set (mirror, PORTALCLIP); // clip at portal plane 
       while (1) 
       { 
               proc_kill(4);
               mirror.genius = camera.genius; 
               mirror.aspect = camera.aspect; 
               mirror.arc = -camera.arc; 
               mirror.x = camera.x; 
               mirror.y = camera.portal_y - (abs(camera.portal_y - camera.y)); 
               mirror.z = camera.z; 
               mirror.pan = -camera.pan; 
               mirror.tilt = camera.tilt; 
               mirror.roll = camera.roll; 
               wait(1); 
       } 
}



Last edited by Blink; 07/15/10 21:08.

My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: vertical mirror help.... [Re: Blink] #333393
07/16/10 04:58
07/16/10 04:58
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
well its a view entity , so its not for a 3d object in your world at a quick glance it looks like a rear view mirror code for a driving game or something , but im not 100 % sure

Re: vertical mirror help.... [Re: badapple] #333429
07/16/10 13:16
07/16/10 13:16
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
i think i copied the wrong code,lol. i guess i don't need a vertical mirror, i just thought it would be cool. Thanks Bad.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: vertical mirror help.... [Re: Blink] #336943
08/07/10 03:05
08/07/10 03:05
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
can someone give me instructions on how to properly use the mirror function? i have A6:60 pro. i think this is the right code. how do you set up the mirror, which wall, etc?

Code:
//////////////////////////////////
//vertical mirror//////////////
/////////////////////////////
function mfx_mirror();


VIEW view_mirror { layer = -1; };

function mfx_mirror()
{
// do nothing if mirror is already running
	if (view_mirror.visible == on) { return; }

	view_mirror.visible = on;
	view_mirror.noshadow = on;	// suppress shadows in the mirror
	view_mirror.nocull = on;    // view through walls
	 
	view_mirror.portalclip = on; // clip at portal plane
	vec_set(view_mirror.portal_x,vector(0,0,my.z + my.max_z)); // at top entity position
	vec_set(view_mirror.pnormal_x,vector(0,0,1.0)); // horizontal plane
	
	while (view_mirror.visible == on)
	{
		proc_late();	// place it at the end of the function list - the camera must be moved before
		view_mirror.genius = camera.genius;
		view_mirror.aspect = camera.aspect;
		view_mirror.arc    = camera.arc;
		view_mirror.fog_start = camera.fog_start;
		view_mirror.fog_end   = camera.fog_end;
		view_mirror.clip_far  = camera.clip_far * 0.5;
		view_mirror.clip_near = camera.clip_near * 2;
		view_mirror.x 	   = camera.x;
		view_mirror.y 	   = camera.y;
		view_mirror.z 	   = 2*view_mirror.portal_z-camera.z;	// move the camera at its mirror position
		view_mirror.pan    = camera.pan;
		view_mirror.tilt   = -camera.tilt;	// flip the vertical camera angle
		view_mirror.roll   = -camera.roll;
		wait(1);
	}
}
action mirrored 			
{
	mfx_mirror();
}




My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: vertical mirror help.... [Re: Blink] #336956
08/07/10 06:01
08/07/10 06:01
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Yes, it's an old mirror script.
I made a vertical mirror effect using C-script a while ago(JuOn?). But it's gone along with my old HDD grin.
B2T, to create a mirror effect in C Script, there are some 'rules':
1. The mirror surface must be flagged mirror(of course). And the other surface of the block should be flagged none.
2. The block should be the outer area(doh, how should I describe this). There must not any block or model behind/intersecting the block
3. Creating vertical mirror is a bit tricky since each mirror direction needs different code, which I forgot, sorry :D, but the point is, rather than changing the view_mirror.z, you change, view_mirror.x or view_mirror.y(depends on which direction the mirror is facing). The same applies to view_mirror.pan, tilt and roll

Re: vertical mirror help.... [Re: bart_the_13th] #336959
08/07/10 06:21
08/07/10 06:21
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
i almost understand. so i can use a simple map entity for that, right? and the code i posted above should work for a6?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: vertical mirror help.... [Re: Blink] #336962
08/07/10 06:38
08/07/10 06:38
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Of course, any simple map should work. For your code above, only floor mirror work, so just mirror flag the floor top surface while other surfaces(for the same block) get none flag.

Re: vertical mirror help.... [Re: bart_the_13th] #336963
08/07/10 06:55
08/07/10 06:55
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
so, this code wont work for the vertical mirror?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: vertical mirror help.... [Re: Blink] #336964
08/07/10 07:23
08/07/10 07:23
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
I done something like this when I first started with A6 and from memory I think what I did was play around with tilt and either x or y eg:" + instead of -"
but I think you get the idea laugh .

Try that anyway and see how you go, It may help you to solve your problem if anything.


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: vertical mirror help.... [Re: Nidhogg] #337871
08/14/10 00:40
08/14/10 00:40
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
does anyone understand how to change the x and or y to make this a vertical mirror. i guess thats why it isnt working? i just want a mirror effect in my room. can anyone explain the steps to make it work as well?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Page 1 of 3 1 2 3

Moderated by  Blink, Hummel, Superku 

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