Skip to navigation


3D geometry: SetObjectCoords (Part 4 of 11)

Name: SetObjectCoords (Part 4 of 11) [Show more] Type: Subroutine Category: 3D geometry Summary: Pre-process the object groups (objects 6, 7, 8 or 9) Deep dive: 3D objects
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
\ If we get here then the object ID is 6, 7, 8 or 9, so \ this is an object group (e.g. a tree) LDA #8 \ Set objCount = 8 to act as a counter in the loop STA objCount \ below, so we work through all 8 objects in this object \ group .objc2 LDX objectGroup-6,Y \ Set X = 0, 8, 16 or 24, for Y = 6, 7, 8 or 9 \ \ (or 1, 9, 17, 25 etc., depending on the current group) LDA xGroupObjectHi,X \ Set the object's x-coordinate to the X-th entry in STA xObjectHi,Y \ xGroupObjectHi, which contains the high byte of the \ group object's x-coordinate LDA zGroupObjectHi,X \ Set the object's z-coordinate to the X-th entry in STA zObjectHi,Y \ zGroupObjectHi, which contains the high byte of the \ group object's z-coordinate JMP objc9 \ Jump to objc9 to process this object