Missing ResetMatrix()
Monkey Forums/Monkey Bug Reports/Missing ResetMatrix()
| ||
Again apologies if this is considered spam. Just trying to help fill in some of the blanks. There are a few missing graphics commands. Very simple ones: |
| ||
resetmatrix would mess up autofit wouldnt it? best to use push and popmatrix |
| ||
Hmmm really? how do you mean mess up auto fit? If you look in monkeys internals you can see it does a "resetmatrix" before every render anyway. Most of the time when I am doing complicated stuff I will precalculate a nodes matrix and save it until it changes. This way most of the time there is no push/popping all over the place and we can avoid over-calculating. This is a snippet from a "camera" node I have. You can see here it is resetting the matrix so it can draw a border around the viewport in world coordinates. The GetWorld______() methods will check to see if the node is "dirty" (has been modified) and if so will force its matrix to be updated before returning any state. |
| ||
I agree that this method should exist. Personally I'd call it LoadIdentity(). Unless you want it to actually clear the entire matrix stack, but I think that's a bad idea. It might break internal Mojo stuff when you use it (if not now, possibly in the future). |
| ||
autofit alters the matrix at the beginning of onrender, (after the BeginRender function) so loading the identity matrix after that will mess it up |
| ||
so loading the identity matrix after that will mess it up Correct. Being able to load the identity matrix would still be a useful function though. In the meantime, SetMatrix(1,0,0,1,0,0) will have to suffice. |
| ||
Where is this autofit though, is it part of a framework or something? Never heard of it being part of monkey. Is what I am doing going to break anything? As I have never noticed any issues before..? ResetMatrix is probably confusing yeah. Something like ExpandMatrix() or RevertMatrix() would be more blitz/monkeyish! |
| ||
Where is this autofit though, is it part of a framework or something? Where have you been? ;) Autofit is the defacto standard to create Virtual Resolutions in Monkey, check out the bananas/hitoro/autofit folder... also its by James Boyd (DruggedBunny). |
| ||
Haha under a non autofitted rock. Lol well I did that method before, I was just a bit confused as it sounded like adding "resetmatrix" would break monkey. |