Post

Replies

Boosts

Views

Activity

Reply to Metal Perspective Martrix issue
the net result was: the book I was following made assumptions that turned out to be wrong. The code in the book could never work. the Matrix4x4 structure in the book assumes a row layout in the the float4x4 used in Metal. It doesn't work like that. it uses a Column layout. ie: the matrix I built from the tutorial assumed that each simd_float4 passed in was going to be a row. instead it was a column. this screwed up everything. but I also had issues with the matrix weirdly breaking my identity values. that screwed up everything. and my rotation function, was faulty.
Topic: Graphics & Games SubTopic: General Tags:
Oct ’20
Reply to Mac swift Xib based doc app deletes a doc when I make changes and then save it.
here is what caused that issue: when you save the file for the very first time, your identifier is exactly the way you type it in in the text field. here's mine: com.BkTools.blockingDoc when you save changes to a file, the identifier is lowercased: com.bktools.blockingdoc I actually test for my type identifier, because I will probably need to have more than one. So I uses a Switch. and the list of options needs to be exhaustive, so I have a Default: option that returns an empty Data() But that should never get called. under any circumstances. I have a closed loop here. I am saving MY file type, I Am opening MY file type. I have written down MY identifier, so I can Expect MY file identifier. except. I can't. Somebody transforms my identifier before I get it. which is a cardinal sin. WORSE, they transform my identifier, only SOME of the time. which in my book is far far worse a cardinal sin. the workaround... when I inevitably run into this problem again and there's no documentation then either: is to either use all lowercase in the identifier, or to use the convenience method : lowercase() on the string in the switch and just check for the lower case version. half a day looking for that little gem.
Topic: UI Frameworks SubTopic: AppKit Tags:
Nov ’23