freenode/lisp - IRC Chatlog
Search
5:08:21
borei1
to define orphographic projection matrix i need to supply 2 arguments r-min and r-max, i created the following generic function
5:10:41
borei1
(setf (orpho projection-matrix) (vector -5.0 -5.0 -5.0 1.0) (vector 5.0 5.0 5.0 1.0))
5:11:51
|3b|
and i think you have to use the complicated SETF stuff rather than just a setf function
5:15:58
|3b|
would (orpho projection-matrix) return rmin and rmax? (and is "orpho" spelling from some other language? haven't seen that before)
5:16:35
|3b|
if not, i wouldn't expect (setf orpho) to accept rmin+rmax, regardless of how you combine them
5:18:32
|3b|
ACTION assumed it was from "orphographic" as used above, just not sure if that is "orthographic" in some other language or just a typo :)
5:24:39
|3b|
and unless it is identity or pure scale, just setting the diagonal is an odd thing to do
5:26:22
|3b|
if you have (0 0 1 0, 0 1 0 0, 1 0 0 0, 0 0 0 1) and set the diagonal, you get something like (2 0 1 0, 0 2 0 0, 1 0 1 0, 0 0 0 1), when you probably wanted (0 0 2 0, 0 2 0 0, 2 0 0 0, 0 0 0 1)
5:27:00
|3b|
when you want to do is multiply by (2 0 0 0, 0 2 0 0, 0 0 2 0, 0 0 0 1), which will give you the 2nd result rather than just setting the diagonal
5:27:36
|3b|
and will also rotate the axes correctly, scale translations, etc as expected depending on which order you multiply
5:29:15
|3b|
right, i would expect it to usually have concatenation of a bunch of rotation and translation (and possibly scale)
5:31:53
|3b|
if your model-view transform is "scale 2" "move x +1" "scale 3" "move y +2" "rotate 30deg" "scale x 4", you can't use your (setf scale) for anything but the first one
5:32:38
|3b|
so instead you would just have (make-scale-matrix sx sy sz) and multiply that by mv matrix
5:33:39
|3b|
or possibly (scale-matrix m sx sy sz) if you want to optimize it a bit and modify the matrix in place, but that would still be doing more than just setting the diagonal, it would have to do a bunch of multiplies and adds internally, just optimized for the elements it knows are 0 in the scale matrix
5:34:46
|3b|
ACTION would just use the generic version though, unless you are writing a ray-tracer or other software renderer where you are doing a /lot/ of specialized operations with known matrices
5:37:06
borei1
once matrix are defined they will be pushed to shader unifor and will continue to live there
5:38:17
borei1
but definetely i got some ideas after discussion - i completely missed sequential operations
5:38:35
|3b|
yeah, view tends to change per frame but also isn't very complicated to build, so not worth optimizing
5:40:50
|3b|
might also look at sb-cga and various other game/graphics math libs and see what they do
5:41:47
|3b|
https://github.com/lispgames/lispgames.github.io/wiki/Common-Lisp#Math has a list (implementing math libs seems fairly popular :/ )
5:46:58
jdz
It looks really weird when reading a sentence, and the terminating punctuation is at the start of the next line.
5:49:08
beach
|3b|: It is an occupational hazard. From reading papers by students and colleagues for a few decades.
6:47:38
pjb
minion: memo for didi: (let (v1 v2 (v3) (v4 nil) (v5 'something-different)) (list v1 v2 v3 v4 v5)) #| --> (nil nil nil nil something-different) |#
6:52:15
pjb
I wonder if the typographic manual of the Imprimerie Nationale has been updated for unicode…
13:30:56
Shinmera
More fun with my CL slideshow app https://www.youtube.com/watch?v=KtLaw5-kI54&feature=youtu.be
13:33:43
_death
Shinmera: hey, does it make sense to write a parachute test like this? https://plaster.tymoon.eu/view/741#741
13:34:32
Shinmera
beach: Of course. It's already on github, but I do plan on providing a more usable version as well.
13:35:24
Shinmera
_death: I do pretty much this here, for instance: https://github.com/Shinmera/3d-vectors/blob/master/test.lisp#L183
13:37:35
_death
cool.. parachute lacks support for package-inferred-system style test suite, but I'm just going to stuff all the tests in one file so it's ok.. also, does it have a reporter that just displays the tests and not every test form?
13:49:02
Shinmera
(defclass my-report (parachute:plain) ()) (defmethod parachute:report-on :around ((result parachute:result) (report my-report)) (when (typep result 'parachute:parent-result) (call-next-method)))
13:50:46
Shinmera
Or you could specialise on value-result and do nothing. I think all of the standard test forms emit subclasses of value-result.