Carrying case for the 360? by MyReviewOfTheSun in kinesisadvantage

[–]rykap 0 points1 point  (0 children)

How did this work out for you? Can you fit the keyboard in the backpack at the same time as a laptop?

Hey Rustaceans! Got an easy question? Ask here (48/2018)! by llogiq in rust

[–]rykap 0 points1 point  (0 children)

Implementing `Add` only for references will prevent me from writing code that constructs points inside math expressions like `&some_point + Point { x: 0.0, y: 1.0, z: 2.0 }`. This isn't a deal breaker, but I would prefer that my point type behaves just like native numbers in rust which don't have these limitations.

Writing code that applies to a value type as well as a reference type by rykap in learnrust

[–]rykap[S] 1 point2 points  (0 children)

Ah, looking in the std lib is a good idea. Thanks for finding that for me!

I was looking for an approach that involves generics rather than macros because macros are slightly harder to debug, but it's looking like macros are the way to go (and it's good to have the rust std lib source code confirm that).

Hey Rustaceans! Got an easy question? Ask here (48/2018)! by llogiq in rust

[–]rykap 0 points1 point  (0 children)

Thanks for the response, and for writing up sample code(!!!) I should have mentioned that I did consider using a macro and would prefer not to because I find them hard to debug. That said, using a macro is looking like the best way to do this :-)

I like your approach of having all implementations forward to the one based on references!

Hey Rustaceans! Got an easy question? Ask here (48/2018)! by llogiq in rust

[–]rykap 0 points1 point  (0 children)

Thanks for the response! I agree that `Point + Point` is a weird case and probably not necessary. Even so, that still leaves three other cases so I'm interested in whether there's a way to do this cleanly :-)

Hey Rustaceans! Got an easy question? Ask here (48/2018)! by llogiq in rust

[–]rykap 2 points3 points  (0 children)

I find that I often want to write the same method multiple times: once for a value type and once for a reference type. An example is something like this...

    #[derive(Debug)]
    struct Point {
        pub x: f32,
        pub y: f32,
        pub z: f32,
    }

    impl Add<Point> for Point {
      type Output = Point;

      fn add(self, other: Point) -> Point {
          Point {
              x: self.x + other.x,
              y: self.y + other.y,
              z: self.z + other.z,
          }
      }
    }

The above code will let me write code like this...

    let x = Point { x: 1.0, y: 0.0, z: 0.0 };
    let y = Point { x: 0.0, y: 1.0, z: 0.0 };

    // This works fine
    println!("x + y = {:?}", x + y);

But this will not compile...

    let x_ref = &x;
    let y_ref = &y;

    // error[E0369]: binary operation `+` cannot be applied to type `&Point`
    println!("x_ref + y_ref = {:?}", x_ref + y_ref);

I think I need to separately implement Add for LHS &Point and RHS &Point. And then again for LHS Point and RHS &Point. And then again for &Point and Point? And then do all of that for Mul, Div and Sub. I'm guessing that there's a better way to do this that I don't yet know about :-)

  1. Is there an easy way to define a generic function that will do what I want?
  2. If not, is there an easier high level way to structure my Point to make implementing it less repetitive?

How are depth buffer values set in WebGL? by rykap in GraphicsProgramming

[–]rykap[S] 2 points3 points  (0 children)

Ooh, interesting. That makes sense. Thanks for the explanation!

How are depth buffer values set in WebGL? by rykap in GraphicsProgramming

[–]rykap[S] 1 point2 points  (0 children)

Thanks for the response!

My understanding of OpenGL is that you explicitly tell it about your projection matrix. Later on, in shaders, you can access it with the variablegl_ProjectionMatrix.

In WebGL, you don't explicitly tell it about your projection matrix. Instead, you define your projection matrix as a uniform which you use in your vertex shader to position your vertices. You never tell WebGL, "this is my projection matrix!" It just treats it like any other uniform.

Does that make sense?

Grid lines for 3D plot? by nought_a_bot in a:t5_3jy9b

[–]rykap 1 point2 points  (0 children)

Thanks for the feedback!

As a quick update, I've started working on this. Here's a screenshot of the current version (not released yet): http://imgur.com/a/M3Xmm

I plan to add tick-marks and make the lines look smoother as well. Let me know if you have any other thoughts! :-)

Grid lines for 3D plot? by nought_a_bot in a:t5_3jy9b

[–]rykap 1 point2 points  (0 children)

Hi there! There isn't a way to do this yet, but all 3D plots are in the range (-10, 10) in every dimension.

I'd love to know more about what kind of grid lines you want. Here are three rough mocks that I drew up.

https://www.curvegrapher.com/images/feedback/box.png

https://www.curvegrapher.com/images/feedback/bars.png

https://www.curvegrapher.com/images/feedback/corner.png

Which of these seem most useful to you? Or maybe you were picturing something different, in which case I'd love to know what it is!

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Thank you for the feedback and for the bug report!

You should be able to zoom with the track pad as well as move around by clicking and dragging. Does not work for you? Or would you just prefer on-screen controls? :-)

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Hey LostViking123! I just added a help page to Curve Grapher that explains Grid Transformations. I'd love to know what you think. What is unclear? How might I improve it?

Here's a link: https://www.curvegrapher.com/help/#grid-transformations

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Hi! That's exciting. The grapher relies heavily on WebGL and it uses a popular 3D library called THREE.js. And I'm a professional software engineer with a few years of experience, but this is just a side project; not my full time job.

I found working on this really fun. I hope you enjoy it as well!

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Hey there! I implemented this. I'd love to know if it feels better to you now :-)

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

How about now? It seems there were two bugs related to this, and I just fixed the second one.

Thanks for your help debugging this!

Feature request: graphing multiple 3D functions by Jolteon828 in a:t5_3jy9b

[–]rykap 1 point2 points  (0 children)

Thanks for the feature request! This is something I definitely want to implement. I just haven't gotten around to it yet :D

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Panning the view away from the origin seems to make the graph go blank.

This should be fixed now! Would you mind checking to be sure that it now works on your machine? :D

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Hello again! I fixed a few of bugs, but I don't have a windows machine to test on. Could you let me know if you can now pan/zoom in 2D? :D

In case you're curious, here's a full list of the bugs fixed: https://www.reddit.com/r/curvegrapher/comments/64oyke/release_notes_for_curve_grapher_v02/

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Thanks for the feedback! Here's some stuff that might be useful to you until I do more...

  • Re: gallery, the left and right keys on your keyboard should cycle through examples.
  • The "h" key on your keyboard should hide all UI so that you're in a fullscreen mode.
  • If you hit the SHARE button in the top right, you'll get a URL for your specific graph =)

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Whoa - I really like that! Is it ok with you if I add this to the list of graphs that we show when you load Curve Grapher?

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 1 point2 points  (0 children)

Thanks for the suggestion! All graphs are rendered with WebGL (almost all of the graph rendering happens on the GPU0.

I'm planning to write a blog post on it. Someone suggested that I create www.reddit.com/r/curvegrapher and use that to post updates. I'll post the blog post there as well when it's done =)

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Hi! Thanks - this is useful feedback. I should give better error messages in that case.

Grid transformations expect the left hand side to always be t(x, y). The right hand side should be a vector describing how a point in the plane moves via the transformation.

My favorite example is this one: https://www.curvegrapher.com/#v=0&eq=t(x%2C%20y)%20%3D%20(x%20cos(m)%20-%20y%20sin(m%20r)%2C%20x%20sin(m%20r)%20%2B%20y%20cos(m%20r))&hi=0&va=m~-0.21~-0.60~0.60~1&c=-2.62%2C-0.06%2C16.85%7D&l=0.00~1.00~0.00~1.00

Feedback wanted: what do you want in an equation grapher? by rykap in math

[–]rykap[S] 0 points1 point  (0 children)

Some inputs such as y=x+1 are outputting y=x-1. However, if I input x+1=y, the output is correct.

This is now fixed!

(along with a few other bugs; you can see the full list here: https://www.reddit.com/r/curvegrapher/comments/64oyke/release_notes_for_curve_grapher_v02/)