Sign in to follow this  
Guest

Fence.. Sun light effects (see Pic)

Recommended Posts

Hi allI'm back with my fence and a lighting/shading problem. In the picture below there is two identical DXT1(A), one with minus a post!!! the time of day is middayI can't understand why the lighting is different on them, the textures come from the same *.psp file/source, below is the code I have used, calling from a library object...

; ------------------------------------------------------------------------; FENCE MACRO; ------------------------------------------------------------------------ Area( 5 52:37:52.257002 -03:09:3.908071 5 );   Start of library call  IfVarRange( : 346 3 32767 ) PerspectiveCall( :persp ) Jump( : ):persp;   Perspective :Fence1;-------------------------------------------------------------------------   RefPoint( rel :Fence2  1 52:37:52.257002 -03:09:3.908071 		V1= 2000 V2= 1000 )       RotatedCall( :objcall 0 0 47.402679 ); rotate object to user preset	  :Fence2;-------------------------------------------------------------------------      RefPoint( rel :Fence3 1 52:37:52.257002 -03:09:3.908071 		V1= 2000 V2= 1000 )       RotatedCall( :Trans_01 0 0 47.402679 ); rotate object to user preset      :Trans_01	 	  TransformCall( :objcal2 -7 0 0			  0 0000   0 0000   0 0000 )

This is the Object in the Library, I have rem'ed out alot of commands because I thought they were old and unnecessary, I could be wrong!!! didn't want crash detection, either!!

;---------------------------------------------------------------------------------------------; FENCE---Twin--Posts-------------------------------------------------------------------------;---------------------------------------------------------------------------------------------ObjId( 0013CC70 0013CC6E 00517344 4D415402 )  LibObj( PWR 100 SIZE 0 SCALE 0.1 TYPE 0x203 NAME Fence ) ;:fence_01;	ShadowCall( :fence_02 );:fence_02Monitor3D( :fence_nocrash -0 0 0 0 -0 0 );Setvar( 284 14 ):fence_nocrashPoints( 0	-3 0 0							; 0	-3 4 0							; 1	 3 4 0							; 2	 3 0 0							; 3	  )LoadBitmap( 0 0 0 0 0 0 Wfence.bmp  );ConcavePoly;BitmapMode( 1 );Inst_7DTexPoly(   a   		0   0	0  ; point 0		1   0	255; point 1		2   255  255; point 2		3   255  0  ; point 3		);BitmapMode( 0 );ConcavePoly;BitmapMode( 1 );Inst_7DTexPoly(   a   		3   255  0  ; point 3		2   255  255; point 2		1   0	255; point 1		0   0	0  ; point 0		);BitmapMode( 0 )Return:EndEndObj; End of LibraryObject ;---------------------------------------------------------------------------------------------; FENCE1--Single--Post------------------------------------------------------------------------;---------------------------------------------------------------------------------------------ObjId( 0023CD70 0023CC6E 00517344 4D411402 )  LibObj( PWR 100 SIZE 0 SCALE 0.1 TYPE 0x203 NAME Fence ) ;:fence_01;	ShadowCall( :fence_02 );:fence_02Monitor3D( :fence_nocrash -0 0 0 0 -0 0 );Setvar( 284 14 ):fence_nocrashPoints( 0	-3 0 0							; 0	-3 4 0							; 1	 3 4 0							; 2	 3 0 0							; 3	  )LoadBitmap( 0 0 0 0 0 0 Wfence01.bmp  );ConcavePoly;BitmapMode( 1 );Inst_7DTexPoly(   a   		0   0	0  ; point 0		1   0	255; point 1		2   255  255; point 2		3   255  0  ; point 3		);BitmapMode( 0 );ConcavePoly;BitmapMode( 1 );Inst_7DTexPoly(   a   		3   255  0  ; point 3		2   255  255; point 2		1   0	255; point 1		0   0	0  ; point 0		);BitmapMode( 0 )Return:EndEndObj; End of LibraryObject

I am uncertain why in the texpoly() command the 0-3 are reversed for the otherside of the fence!!once again I am in need of help, hope somebody can!!!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

>I am uncertain why in the texpoly() command the 0-3 are >reversed for the otherside of the fence!! That's just what I wanted to ask. Normally you use the option a and ai for the two different sides. But I know for the new FP commands the order of the points also has an influence on which side is drawn, maybe this is the same.For the rest the code looks OK to me, I don't see any differences between the two sources. Do you call them different from the macro?Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

Cheers ArnoOnce again, you were looking in the right direction, I'm not reading my Scasm Doc's enough, am I!!!I do actually think I am getting some where, I actually only needed the one Texpoly() (0123), I think I thought you needed one Texpoly() for each side of the polygon!!Thanks againRegardsDave

Share this post


Link to post
Share on other sites

Hi ArnoThat's enough confusion for one nightI coded the fence like this, which seem ok, except that may be the sunlight effect is applied to both sides. Manfred's notes state that the brightness is apllied equally, which in this case, is! although it does appear to be drawn as if the sun was shining on both sides.

TexPoly( m 0 32766 0 -100		0   0	0  ; point 0		1   0	255; point 1		2   255  255; point 2		3   255  0  ; point 3		)

May be that has confused you!!!The fence I have is what I am looking for, except it may be a little flat looking. I did think about applying a actual 3d post with texture applied, but that would cost more in frame rates.When landing there is a limit to what you can look at, only when taxing and up close could this make a difference!Thanks for your helpDave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this