This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-13
Channels
- # aleph (1)
- # beginners (105)
- # boot (6)
- # cider (9)
- # cljs-dev (61)
- # cljsrn (59)
- # clojure (132)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-russia (18)
- # clojure-spec (1)
- # clojure-uk (58)
- # clojurescript (56)
- # core-async (1)
- # cursive (17)
- # datomic (20)
- # docs (1)
- # duct (5)
- # editors (1)
- # emacs (7)
- # events (2)
- # figwheel (7)
- # fulcro (30)
- # graphql (8)
- # jobs (3)
- # leiningen (23)
- # luminus (14)
- # mount (6)
- # off-topic (41)
- # onyx (14)
- # protorepl (2)
- # re-frame (7)
- # reagent (32)
- # shadow-cljs (236)
- # tools-deps (92)
- # unrepl (8)
- # vim (60)
- # yada (1)
I need to parse a sequence of strings, where one of the values may represent a number n that determines how many subsequent values to group together. For example
;input
["john" "doe" 2 "USD" 200 "CAD" 130]
=>
;output
{:fname "john"
:lname "doe"
:money {"USD" 200
"CAD" 130}}
so the 2 in the input dictates that it will be followed by 2 pairs representing currency/value.
Is there some sort of terminology (from parsing/compiler design or anything else) to describe what's going on here?I have the classical problem of: I'm running my app, there are no runtime errors in the console, and my screen shows the color of glClearColor, but not the triangle I am trying to draw.
The custom shader also compiled fine. The binding vertec/element-array buffers also works. Somehow, the drawElement is not showing anything.
It's not the shader which is at the fault -- the shader literally just outputs a single color.
disable stuff until it works = my OpenGL debugging method
disable the shaders, disable the transforms
disable the projections, lol
I'm literally trying to draw two triangles with a shader that just outputs the attrib values.
Right so in that case, switch to a single triangle with no view transformation and the screen transform matching the screen co-ordinates
No, since those really don't exist
The thing is those sorts of abstractions have to be built with shaders etc and you'd then work in a higher level engine
The "camera" is purely a construct programmers use to talk about the projection vs object transforms
Another option is to switch to using a scene graph
I would try to draw a single triangle first with a vertex/fragment shader and some hard coded matrices
Or depending on what you want to achieve maybe use a higher level library like Three?
@qqq a helpful exercise is to write a simple rasterizer, you will understand why there is no spoon 😉
although for this particular thing, step 1 is to just use the vertices in your vbo as is (e.g. make a triangle with the coords (-1,-1), (1, 1), (1, -1)) and paint it a different color than your clear color in your shader
I've even sprinkled (. js/cnosole log (.getError gl)) evberywhere, and they are all returning 0
white triangle on a black screen, the hello world of OpenGL.
Made 50x harder in WebGL.
"Back when I was a kid we didn't have VBOs and shaders, we called glVertex3f in a loop like god intended!"
I was using ::width ::height on a "window object", but was in the wrong namespace, so I got nil, which (/ nil 2) ==> gave me 0, which screwed up all the projection matrices ...
Huh, never knew that (/ nil 2) was 0 in ClojureScript. It raises an exception in Clojure/JVM
@andy.fingerhut: that threw me off too
Reminds me of this 4-minute talk by Gary Bernhardt, which entertainly pokes fun at weirdness in some dark corners of Ruby and JavaScript: https://www.destroyallsoftware.com/talks/wat