SRF in notepad

YSFlight addon development, questions, tutorials, & more!
Post Reply
Boom
Contributor
Contributor
Posts: 359
Joined: Sat Dec 10, 2011 10:28 pm
Favorite Aircraft: F-15, F-22
Has thanked: 13 times
Been thanked: 8 times

SRF in notepad

Post by Boom » Sat Dec 24, 2011 7:29 pm

I want to make some dead accurate srf models of text, cubes, cones, cylinders, etc in notepad. I know what COL, VER, and stuff means but what is NOR? If there already is a list, could you link me to it? i've searched and no luck, people apparently use other software (for obvious reasons).

Iceman
Core Staff
Core Staff
Posts: 1399
Joined: Wed Feb 02, 2011 5:47 am
Favorite Aircraft: F-16C Viper
Has thanked: 86 times
Been thanked: 139 times

Re: SRF in notepad

Post by Iceman » Sat Dec 24, 2011 8:12 pm

NOR specifies the normals directions in the SRF. It's best if you leave those at 0 and configure them within gepoly.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Homie I'll SQL YOUR syntax

Boom
Contributor
Contributor
Posts: 359
Joined: Sat Dec 10, 2011 10:28 pm
Favorite Aircraft: F-15, F-22
Has thanked: 13 times
Been thanked: 8 times

Re: SRF in notepad

Post by Boom » Sat Dec 24, 2011 10:22 pm

normals?

User avatar
Taskforce 58
Veteran
Veteran
Posts: 680
Joined: Thu Feb 10, 2011 9:06 pm
Favorite Aircraft: F-104, Tu-95, Piaggio Avanti
Location: YYZ VOR 062 radial, 17.5 DME
Has thanked: 53 times
Been thanked: 236 times
Contact:

Re: SRF in notepad

Post by Taskforce 58 » Sat Dec 24, 2011 11:28 pm

The normal is an imaginary line (vector) extending out from the surface of the polygon. The length of this line doesn't matter, only it's direction. If you look at the polygon from within 90 degrees of the normal, then the polygon is visible (i.e. you are "in front" of the polygon). If a polygon has no normal defined, then it is visible on both sides. Usually the normal extends perpendicularly from the polygon, but in extremely rare cases you can have a non-perpendicular normal (I did that with the "Meatball" landing lights on my carrier in the Taca Island map).

Like Iceman said, don't try to mess with the raw SRF file in notepad, especially when the normals are concerned. You need to have a solid understanding of 3-D trigonometry (which is something I urge all modders to learn) to do it, and usually it is not worth the hassle to do raw editing in notepad.

Learn gepolyX and/or gepolyO. IT. IS. NOT. DIFFICULT. They both operate around the three most basic sets of functions you need to know:
1) Plotting a vertex
2) Joining these vertices to form a polygon.
3) Defining which side of the polygon a normal should be pointed at.
Image

User avatar
vincent
Contributor
Contributor
Posts: 202
Joined: Wed Feb 02, 2011 7:31 pm
Favorite Aircraft: virtual ones
Location: Toulouse, France
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: SRF in notepad

Post by vincent » Sat Dec 24, 2011 11:44 pm

Exactly, NOR or N specifies 6 values which are the three coordinates of the center point of your face followed by the three components of the face normal vector.

For buildings regular meshes which are not in the GEOPOLY toolbox such as polyhedrons, knowing the SRF format is very handy.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests