freenode/#lisp - IRC Chatlog
Search
23:10:13
Shinmera
My slide show app is coming along. https://www.youtube.com/watch?v=bB0BlN8ORiA&feature=youtu.be
23:25:29
hjudt
are there any best practices naming accessors? if i have a class "box" with a slot "id", should i call the accessor box-id or simply id? is there any advantage doing the former?
23:31:39
Xach
hjudt: I find it useful to think of the protocol of generic functions first, and then use defclass to fill in the easy blanks of specific methods. in that context it doesn't make sense to name the generic functions with the class name (usually).
0:24:23
didi
Wonder: Why isn't the syntax of `let' the same of `setf'? i.e. (let (a a-value b b-value) ...)
0:26:11
fiddlerwoaroof
didi: clpjure does that, it's a bit annoying because it's more difficult to delete a binding/value pair
0:29:09
fiddlerwoaroof
I have actually experimented with writing a wrapper macro for setf that looks like (setf* (a a-value) (b b-value))
0:31:09
Bike
i don't think there's much particular reason either way. of course, if you do write a let like that it's short for ((a nil) (a-value nil) (b nil) (b-value nil))
0:34:08
fiddlerwoaroof
didi: it's nice, but I'm always hesitant to introduce new things for such a trivial reason
0:50:49
Zhivago
I think the savings with setf are minimal -- with let it makes more sense since it would otherwise introduce one scope per variable.
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.