Help with Poly() and Vecpoints() in Scasm

Recommended Posts

Hi allI am trying to understand the relationship between the Points() & Poly() commands and Vecpoints() command, It's the Vector's that I am struggling with!!!Points( 0 0 790 10 ; 0 7 790 -4 ; 1 -6 790 -4 ; 2 0 593 10 ; 3 7 593 -4 ; 4 -6 593 -4 ; 5 )Poly( -30083 0 12986 4.10 5 3 0 2 )Poly( 30083 0 -12986 -4.10 5 3 0 2 )I understand that the 5,3,0,2 refers to the point's, I think!!!The second entry is 'Double sided'It's the first four No's which I am struggling with, I think they are (vx vz vy len)The 'Len'= length or distance in refpoints, may be Scale factor and Floating Points, are all similar terms (4.10) I don't understandIt's the vx and vy and their relationship, (-30083 0 12986) the vz=0 because it involves height, I think!!!I believe that these two commands might be better replaced by, Vecpoint() and shadedTexPoly() comands, although I could be wrong!!!sorry if it seems complicated, I may need explicit explanationAppreciate any advice, trying to ensure that the coding I use is efficient on frame rates.RegardsDave

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

Share on other sites

Just want to add to the excellent info of Luis an answer to the last part of the question.It is not possible to use VecPoints() and ShadedPoly() instead of the instructions you know use.The difference between ShadedPoly and Poly is that FS will display a object made with VecPoints/ShadedPoly more smooth then one made with Points/Poly. So if you make a cilinder with 8 sides for example it would still look almost smooth.To make it even more confusing :), a ShadedPoly also has a vector just like the Poly you mentioned. So it makes no difference from that point of view.Arno

Share on other sites

Thanks Guys, in particular to the in depth explanation, I will print these out and eat them and feed back with the bits I'm still lost on, there will still be some, I bet!!!!Thanks againDave

Share on other sites

As promised, I'm back, all!!!!I understand the broad concept that you are trying to explain, its the finer details that I don't understand, hope that isn't a contradition!!!Do the numbers (-30083 0 12986) draw a line that determines the seperation plane. I don't understand the relationship of the numbers to one another------------------------------------------------------------------->30083 0 12986 are the coordinates of the vector. They define a >direction. The numbers could be as well:>-15041 0 6493-------------------------------------------------------------------assumably the No's (15041 0 6493) draw a line at a different angleHow would I ensure that the poly is visable from both sidesI should tress I use FSDS v1, but am trying to learn my own code writingIt seems we could talk for ever about differnt comands and their effect on frame ratesI have read the tutorial at Mat's site by Andreas Klisch, but more often than not, I find myself staring at the scacmd1-3 doc's.Here is some simple code=====================================================================bjId( 0013CC70 0013CC6E 00517344 4D416412 ) LibObj( PWR 100 SIZE 0 SCALE 0.1 TYPE 0x203 NAME HEDGE ) LoadBitmap( 0 6 E0 16 64 16 hedge.bmp ) VecPoints( a 0 -5 0 1 ; 0 -5 10 1 ; 1 5 10 1 ; 2 5 0 1 ; 3 ) ShadedTexPoly( m 0 0 32767 0.00 000 000 000 ; 0 001 000 255 ; 1 002 255 255 ; 2 003 255 000 ; 3 ) :endEndObj ; End of LibraryObject=====================================================================Please excuse the formattingobviously the "a" is in for automactic calculation of vectors, but what might be the manual No's. Are their enough commands for the polygon to be double sided!!!!I would aapreciate further support, think Iam ccompiling Bgl's in my sleep at the moment, trial and error experiemtsRegardsDave

Share on other sites

>Do the numbers (-30083 0 12986) draw a line that determines >the seperation plane. I don't understand the relationship >of the numbers to one another There are the vector of the polygon. See it as a line perpendicular on the polygon. And they determine which part of the polygon is visible (by pointing in that direction).For the vectors of the VecPoints it's ofcourse a bit different (it are points then and not polygons, but the idea is the same).>assumably the No's (15041 0 6493) draw a line at a different >angle If you meant to write (-15041 0 6493) then the angle is the same (only the values are divided by 2). Without the minus there is ofcourse a difference.For double sided polygons you need to repeat the ShadedTexPoly. So you would get:

ShadedTexPoly( m 0 0 32767	0.00 000 000 000; 0 001 000 255; 1 002 255 255; 2 003 255 000; 3 ) ShadedTexPoly( m 0 0 -32767	0.00 000 000 000; 0 001 000 255; 1 002 255 255; 2 003 255 000; 3 )

for a both sided version.And don't forget the Return after the label :end, you need to end a library object with a Return.And maybe it is better if you start learning the new FP commands instead of these old ones?Arno

Share on other sites

Thanks Arno>assumably the No's (15041 0 6493) draw a line at a different VecPoints( m 0-7 0 0 -32767 0 0 ; 0-7 10 0 -18790 26843 0 ; 1 7 10 0 18790 26843 0 ; 2 7 0 0 32767 0 0 ; 3)sorry about formattingI understand what the numbers represent, as you explained, its what -32767 means to -18790 and like wise to 26843Are the first two minus numbers (-32767/-18790) related to the -7 co-ordinates, or is this just coincidentalWhat are the Fp commands, is this to do Gmax?Thanks for the tipsDave

Share on other sites

>I understand what the numbers represent, as you explained, >its what -32767 means to -18790 and like wise to 26843Not sure what you mean here. You must have a normalized vector and the length of the vector should always be 32767 (that's the maximum value of an integer in SCASM). If you do (18790^2+26843^2)^0.5 then you'll see that that is also 32767.>Are the first two minus numbers (-32767/-18790) related to >the -7 co-ordinates, or is this just coincidental Can be coincidence. You could have a negative coordinate, but still want the vector pointing to the other side.>What are the Fp commands, is this to do Gmax? That are the new floating point commands from Fs2002. GMax also makes them (in BGLC), but you can also make them with SCASM. FSDS2 for example also produces them. If all rumours are true then you will only be able to use them in the future, so I think it is better to invest in them now :).Arno

Share on other sites

Hi ArnoUnderstanding the formula that you explained, has helped to understand what these numbers represent. However, I think my ability to create these vectors, manually, myself, are beyond my ability. But having a better understanding, has to help!!!Thanks for the explanation of the Fp commands, I looked at the Scasm doc's and could only find new28x.doc, which I don't think refers to these commands you refer toI would appreciate any links to these new commands, is it in the SDK?thanks for your continued supportDave

Share on other sites

You have found the correct document :).To draw polygons with the new commands you would need the following commands:VertexList, MaterialList, TextureList, SetMaterial, DrawTriList.Arno

Share on other sites

thanks Arno, that was quick!also see their is reference, in the SDK, to fpthanks again

Share on other sites

Yes, there also is a FP SDK, but that is more of help if you want to write the code in BGLC.Arno

Create an account

Register a new account

• Tom Allensworth,
Founder of AVSIM Online

• Hot Spots

• Flight Simulation's Premier Resource!

AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!