Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Learning Scasm code --- Anybody solve this one

Featured Replies

Hi allI have recently started to try to learn coding Scasm by hand, by trial and error!!!!I am baffled by the Texpoly command!I understand that the bitmap offset co ordinates are linked to the points co ordinates, this was a break through, but it is the effect on the bitmap with the offset cordinates, I don't understand, esspecially when the numbers exceed the size of the bitmap. A larger size, say 800x800 seems to reduce the resolution of the bitmap, which in some intances looks better. Even when I get a result I like, I still don't understand how, even though I know how I got their!!! TexPoly( m 0 32766 0 -100 1 bx by ; 1The 'm' stands for Manual, I think, although I could stand to be corrected on that. I take it that {0,32766(maxium in Fs)0,-100) may have replaced the 1,2,3,4 that can be used with the 'ab'or 'at' flags.I am learning, trial and error, here. It would be nice to understand something from all this.Also, What might the advantage be to using this command. The Graphics frontend that has created the *.sca file which I am modifying, just draws the polygon using the points command and then uses the loadbitmap command.I have read the 2.85 Scasm doc's and also Matt's tutorial @combatflight.de, which as been immeasurable, and I couldn't have done without it. I have also downloaded his editor, which is very useful in starting novices off. (Even with his 'Texpoly' template I still fail to grasp this concept)Thank you in advance, for anybody that can unmuddle me, I doubt I am the first or the last.RegardsDave

  • Commercial Member

Hi Dave,This is how the [tt]TexPoly[/tt] command works.First you make a point list with the points command.[tt]Points( 0-100 0 0 ; 0-100 100 0 ; 1 100 100 0 ; 2 100 0 0 ; 3[/tt]Then you load the bitmap you want to use:[tt]LoadBitmap( 0 6 EF 0 0 0 test.bmp )[/tt]Now are going to make a polygon with those points and the bitmap, using the [tt]TexPoly[/tt] command. Let's say we want the upper right quarter of the texture on the polygon, then I would use:[tt]TexPoly( a0 128 1281 128 2552 255 2553 255 128 )[tt]The [tt]a[/tt] specifies which side of the polygon should be drawn. a is the one that is facing away from the [tt]RefPoint[/tt], while [tt]ai[/tt] is the other side (facing to the [tt]RefPoint[/tt]). You can also use the [tt]m[/tt] as you did in your piece of code, if you want to specify the direction vector by hand, but I think most the the time the [tt]a[/tt] and [tt]ai[/tt] work just as good.Than the mapping of the texture on the points. For each point number you give the coordinates on the textures. No mather what the size of the texture is, the lower left corner is always 0,0 and the upper right one is always 255,255. If you exceed the numbers the bitmap will be repeated on the polygon.I hope this helps you a bit :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Hi ArnoThanks for your reply.I think the command is a lot more simple than I thought, although I think you can do a lot more complex things than you suggest.Can I use this command to originate a bitmap in a certain direction ?, if for instance, the bitmap has lines that you may wish to align it, ie a taxiway, runway!!May be there is a rotate command, I think!My main concern is manipulating the bitmap and its resolution, the repeating of bitmaps is not totally realistic in my opinion.Thanks again for your support. It it wasn't for others helping we couldn't asspire to design.Kind regards Dave

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.