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.
13:56:49
_death
Shinmera: I guess a foo-test system that depends on, say, foo/tests/all, and there's a file all.lisp in foo/tests that defpackages foo/tests/all and uses foo/tests/a foo/tests/b etc.. which in turn have corresponding files and packages and contain the define-test forms
14:04:55
_death
suppose I want to check that (foo) results in 2, 3.. do I need to use multiple-value-list? or write a macro that expands to that?
14:05:47
Shinmera
Well, often each value will have a different type, and thus likely a different comparator, so it doesn't make much sense for IS to allow specifying multiple values to compare against.
14:06:06
Shinmera
I could see value in something like (is-values form test-1 value-1 test-2 value-2 ..) though.
14:07:18
Shinmera
For now you'll have to either multiple-value-bind around the test forms (which loses the form in the report), or a multiple-value-list, yeah.
14:19:56
Shinmera
Yeah, the report also won't be too nice. I'm working on a more extensive solution now.
14:47:36
_death
looks a bit weird.. there is a mismatch between the form (which returns 3 values) and the report
14:48:30
_death
for example you'd expect (values 0 "0" 'c) to return 0 as the first value, but the report claims it's "0"
14:50:34
Shinmera
I guess if I just write "the test form .. value x is .." that would be fine if it were 0 indexed.
14:53:27
Shinmera
What would you suggest instead? I'd rather not separately group things into an extra list.
14:54:36
schweers
I need to write some code in order to provide a C interface to some C++ code. Do I have to compile is separately as a shared library and place it somewhere where CFFI can find it (or tell CFFI where to find it), or can I simply tell asdf where to find the code and have asdf and cffi compile and load it?
14:55:40
_death
my ARE operator combines the comparator/value, although it should likely evaluate the latter.. (are ((= 2) (equal "1") (= 0)) (values 0 "0" 'c))
14:58:25
_death
Shinmera: could just use (= 2 equal "1" = 0) .. then it's similar to your is-values except the expectations come first.. but I find the grouping of each pair visually useful
14:58:36
_rumbler31
well, I've been thinking of a few functions to store the shared libs you want to ship as octet vectors, then unpack them and explicitly cffi load them
14:59:19
schweers
anyway, thanks. I guess I’ll just bite the bullet and create and deploy a shared library then.
15:00:09
Shinmera
_death: The rationale behind the ordering in the other operators is that it should feel similar to just (comparison expect value). For multiple values that obviously makes no sense. The idea behind is-values is to make it look more like multiple-value-bind, so I guess (is-values value (comp expected) ..) would be most fitting.
15:00:48
_rumbler31
schweers: I think that's the easier path than trying to statically link some code with any given image
15:02:02
schweers
I’m asking myself what happens if I load a shared library and then dump an image. That shared library is then /not/ embedded in the image, right? Or at least not on every implementation.
15:03:41
Colleen
schweers: Unknown command. Possible matches: 8, about self, set, say, mop, get, logout, grant, block, award,
15:04:01
schweers
I suspected so. please forgive my ignorance, I’ve never done much with shared libraries in any language
15:04:37
Shinmera
They are shared so that they can be used by multiple applications at the same time.
15:10:01
Shinmera
You can also write (is-values .. (= 0 value-0)) if you want. Or anything else as the third argument.
15:23:45
_death
Shinmera: looks good.. instead of ~D~A you can use ~:R to display first/second/... though a bit more verbose
15:31:56
Shinmera
I suppose they don't exist for most because the framework is just a means to an end (I gotta write tests for this other thing)
15:34:18
Bike
testing a test framework with itself is clearly an undefinability theorem violation :p
15:46:38
republican_devil
can you reduce problems with logic liek prolog does in lisp? thus saving a lot fo work?
15:47:33
republican_devil
I mean if I say z means (this list of 100 things) and y means (this other 100 things) then instead of check ing for 200 things, I can check for 2...
15:48:19
republican_devil
so any question of php vs lisp is yes lisp does fine....and is a much smarter language?
15:55:53
Xach
The questions are always similar. Can lisp scale. is lisp better than <some other language. Can I use Lisp for web apps.
15:56:24
jackdaniel
not knowing him are perks of not using usenet (I'm one of the happy non-users ;)
15:57:22
jackdaniel
btw, nice demo with the presentation (despite the fact that I'm allergic to word "neat")
15:58:03
random-nick
Xach: what's the point? wasting people's time? or does he think that lisp is bad at web and wants to troll by pointing that out?
15:58:42
Xach
random-nick: I don't know. It is not just lisp. I suspect some kind of illness or disorder, actually. That doesn't make it much more pleasant to see.
15:58:50
jackdaniel
Shinmera: I hear it way too often on lisp-related communication channels, it is watered down from any meaning for me now
15:59:35
Shinmera
jackdaniel: Okey. I mean, I don't think I used the word anywhere in the demo except in a sarcastic context on the initial cube slide.
16:01:23
jackdaniel
beach: words are neither good or bad, but I agree that correct use is much less unpleasant
16:02:08
beach
jackdaniel: I know how you feel. I prefer to see "cool" used to refer to temperature, for instance.
16:05:00
parjanya
that rejection of new usages tend to be useful, otherwise language would change way too fast, and in different ways according to place etc
16:12:28
jackdaniel
languages change, but it's not that we have no influence on their evolution. it remotely reminds privacy disputes: they know everything then why do you care? ;-)
16:13:52
beach
I recommend Steven Pinker's "A sense of style". It is one of the few non-prescriptive books about the English language.
16:15:42
beach
Plus, he correctly identifies the "problem" as one of communication. So, he is not a defender of pure descriptive grammar ideas. Essentially, if you upset the intended receiver by using certain constructs, then the message won't get across as easily.
16:19:01
parjanya
beach: I like that book. I struggle a little, though, to guess the reader’s sensibilities. People have invented lots and lots of shibboleths, and different people know different sets of them
16:22:29
parjanya
the most absurd one I remember is that some people avoid saying "como" ‘as’ in Portuguese, because it’s homophone of the verb ‘to eat’ that can be used in a sexual sense, so any comparison might sound obscene to them [rolling eyes]
16:23:51
beach
Heh, you could also read Pinker's book "The stuff of thought". there is an entire chapter in there about unacceptable words in different languages.
16:24:19
beach
The chapter also exists as a separate booklet. Something like "the seven words you can't say on television".
16:25:43
beach
https://www.amazon.fr/Seven-Words-You-Cant-Television-ebook/dp/B002RI9QCG/ref=sr_1_1?ie=UTF8&qid=1521217524&sr=8-1&keywords=pinker+seven+words+you+can%27t+say+on+television