From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 1641C7EE63 for ; Fri, 10 May 2013 19:03:16 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUBAConjVFKN1ZKnGdsb2JhbABShnq8X4ESDgEBAQEBCAsJCRQogh8BAQQBI1YFCwsaAiYCAkcQBhuHfgYErEeRKYEmjU8zB4JCMmEDnS8Tji8 X-IPAS-Result: AmUBAConjVFKN1ZKnGdsb2JhbABShnq8X4ESDgEBAQEBCAsJCRQogh8BAQQBI1YFCwsaAiYCAkcQBhuHfgYErEeRKYEmjU8zB4JCMmEDnS8Tji8 X-IronPort-AV: E=Sophos;i="4.87,650,1363129200"; d="scan'208";a="16789159" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 May 2013 19:03:15 +0200 Received: from [172.20.10.2] (92.40.253.91.threembb.co.uk [92.40.253.91]) by smtp.webfaction.com (Postfix) with ESMTP id 610E720F2A82; Fri, 10 May 2013 17:01:45 +0000 (UTC) Date: Fri, 10 May 2013 18:01:38 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Florent Monnier Cc: ocaml-opengl , Caml List Message-ID: <313A2353F5864A008B0EA050D52AC789@erratique.ch> In-Reply-To: References: <5WRK1WTA-CFLT-K2D2-HI4C-UBS0MHNSFIAY@cs.ucy.ac.cy> <5189B929.2030808@riken.jp> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [ocaml-opengl] [Caml-list] standard 3d vector library in OCaml Le vendredi, 10 mai 2013 =C3=A0 16:48, Florent Monnier a =C3=A9crit : > 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 ou= tside gg for now.=20=20 > 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 certa= in 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 y= ou with the essentials to do 2D or 3D computer graphics. Sizes and rectangl= es are ubiquitous: viewports, image extents, etc. and that's the reason the= y are in. More general computational geometry tools are best left to anothe= r dedicated library. =20=20 > 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 wi= ll do. Gg is designed to interoperate with C so that means that the represe= ntation will be cast in stone anyways. > Maybe a compromise could be found, > between one letter function names: >=20=20 > Size3.w > Size3.h > Size3.d >=20=20 > and complete names: >=20=20 > Size3.width > Size3.height > Size3.depth >=20=20 > could be 3 letters abbreviations: >=20=20 > Size3.wid > Size3.hei > Size3.dep Well, no=E2=80=A6 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.=20=20 > 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