caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Florent Monnier <monnier.florent@gmail.com>
Cc: ocaml-opengl <opengl@lists.ocaml.org>, Caml List <caml-list@inria.fr>
Subject: Re: [ocaml-opengl] [Caml-list] standard 3d vector library in OCaml
Date: Fri, 10 May 2013 18:01:38 +0100	[thread overview]
Message-ID: <313A2353F5864A008B0EA050D52AC789@erratique.ch> (raw)
In-Reply-To: <CAE1DttBuONKQQa7xcxPZ9Vnjj=HtUjgUf5bEnQk1bGLwcNmhkw@mail.gmail.com>



Le vendredi, 10 mai 2013 à 16:48, Florent Monnier a écrit :

> A very good link, thanks a lot!
> There's a huge amount of content, could you share which you think
> would be the more interesting for reuse in OCaml?

I think each of them serve different purpose (e.g. computational trade-offs on embedded platforms) that's the reason why these things are best left outside gg for now.  

> It seems logic to me to do it the way you've made it.
> I would only comment that if you add Sizes, BBoxes, then why not also
> bounding-cirlces / bounding-spheres, complete math for geometry with
> points, lines, planes, etc. (distances, intersections, projections,
> etc.)

I don't plan to integrate these things, no pull requests please. At a certain point I was planning to but it was becoming unwieldy -- remnant of these ideas can be seen in the tmp/ directory of the first commit. Gg provides you with the essentials to do 2D or 3D computer graphics. Sizes and rectangles are ubiquitous: viewports, image extents, etc. and that's the reason they are in. More general computational geometry tools are best left to another dedicated library.
  
> The internal representations for vectors and points are not public,
> which would imply to integrate these inside your module.

Regarding the internal representation I still have to think about what I will do. Gg is designed to interoperate with C so that means that the representation will be cast in stone anyways.

> Maybe a compromise could be found,
> between one letter function names:
>  
> Size3.w
> Size3.h
> Size3.d
>  
> and complete names:
>  
> Size3.width
> Size3.height
> Size3.depth
>  
> could be 3 letters abbreviations:
>  
> Size3.wid
> Size3.hei
> Size3.dep

Well, no… it's horrible to read, hard to remember and inconsistent: if you look at all the other vector types in Gg their coordinate accessors all have a single letter V2.{x,y}, P2.{x,y}, V3.{x,y,z}, P3.{x,y,z}, V4.{x,y,z,w}, Color.{r,g,b,a}, Quat.{x,y,z,w}. Having Size2.{w,h} and Size3.{w,h,d} feels natural.  

> I would recommend not to assume that everyone share the same cognition
> and tastes than you.

I certainly don't assume that. I do however program and design to my taste, not by consensus or compromise.

Best,

Daniel



  reply	other threads:[~2013-05-10 17:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07  7:04 [Caml-list] ECSCW 2013: Call for Work-in-Progress Announce Announcements
2013-05-08  2:32 ` [Caml-list] standard 3d vector library in OCaml Francois Berenger
2013-05-08 13:55   ` Florent Monnier
2013-05-09 10:23     ` Daniel Bünzli
2013-05-09 20:27       ` [ocaml-opengl] " Florent Monnier
2013-05-09 22:01         ` Daniel Bünzli
2013-05-10 15:48           ` Florent Monnier
2013-05-10 17:01             ` Daniel Bünzli [this message]
2013-05-10 17:11               ` Anthony Tavener
2013-05-10 10:15       ` rixed
2013-05-15  1:08     ` Francois Berenger
2013-05-10  2:10   ` Francois Berenger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=313A2353F5864A008B0EA050D52AC789@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=monnier.florent@gmail.com \
    --cc=opengl@lists.ocaml.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).