ScratchData LogoScratchData
Back to gtoal's profile

Packed XYZ coordinates

GTgtoal•Created November 5, 2014
Packed XYZ coordinates
1
0
49 views
View on Scratch

Instructions

This is for use in Tailgunner... an X/Y/Z coordinate in the range -1024:1023 can be packed into a single Scratch integer, which makes it a lot easier to pass 3D points around internally... This uses 44 bits. I could easily extend the coordinate range to -2048:2047 by using 48 bits. Games like this were originally implemented in fixed point and a truncated range like this for world coordinates is quite reasonable.

Description

Could be speeded up a little if needed. We'll see how this goes first with the 'obvious' implementation. (This container performs a quick regression test just to check that the code is still working in case it is tweaked...) Extract via backpack.

Project Details

Project ID32838838
CreatedNovember 5, 2014
Last ModifiedNovember 6, 2014
SharedNovember 5, 2014
Visibilityvisible
CommentsAllowed