Re: [Pharo-users] question on syntax "negate numbers"

2014-11-09 Thread Henrik Johansen

> On 10 Nov 2014, at 8:45 , Thierry Goubier  wrote:
> 
> 
> 
> 2014-11-10 7:59 GMT+01:00 Henrik Johansen  >:
> 
> IMHO, the old compiler is right, whitespace should not be allowed in literals.
> 
> Whitespace can be \t or \n,\r which makes for strange literals (multilines) 
> such as:
> 
> -
> 
> 5
> 
> And would create ambiguity in some cases
> 
> is 4 - 5 two literals, or is it two literals separated by the - operator ?
> 
> For instance, 3 @ - 5 reads like gibberish.
> 
> But is 3 @ -5 a problem or not ? Why is the old compiler accepting -3 @ 5, 
> and not 3 @ -5 ?

3 @ -5 is not a problem, and accepted by both.
3 @ -  5 is what I object to (and Opal allows)
3 @-5 and/or 3 @- 5 is (rightly) disallowed by both.

Cheers,
Henry

Re: [Pharo-users] question on syntax "negate numbers"

2014-11-09 Thread Thierry Goubier
2014-11-10 7:59 GMT+01:00 Henrik Johansen :

>
> IMHO, the old compiler is right, whitespace should not be allowed in
> literals.
>

Whitespace can be \t or \n,\r which makes for strange literals (multilines)
such as:

-

5

And would create ambiguity in some cases

is 4 - 5 two literals, or is it two literals separated by the - operator ?

For instance, 3 @ - 5 reads like gibberish.
>

But is 3 @ -5 a problem or not ? Why is the old compiler accepting -3 @ 5,
and not 3 @ -5 ?

Thierry


>
> Cheers,
> Henry
>


Re: [Pharo-users] question on syntax "negate numbers"

2014-11-09 Thread Henrik Johansen

> On 08 Nov 2014, at 5:55 , Werner Kassens  wrote:
> 
> but if you omit the space between - and 3 the old compiler understands it 
> too, hence its just a convenience thing that cant lead to misunderstandings, 
> or?
> btw opal also understands this:
> -3@2. --> (-3@2)
> i mean, its obvious nevertheless that "-" is not a method like negated, but 
> part of a number and opal is just a bit more flexible with number formatting.
> werner
> 
> On 11/08/2014 04:40 PM, Nicolai Hess wrote:
>> Old compiler refuses to accept this code:
>> 
>> - 4 @ -5
>> ^-- nothing more expected
>> 
>> Opal compiler does just fine:
>> 
>> - 4 @ -5 -> (-4@ -5)
>> 
>> who is right?
> 

IMHO, the old compiler is right, whitespace should not be allowed in literals.
For instance, 3 @ - 5 reads like gibberish.

Cheers,
Henry


[Pharo-users] [Survey] Reasoning about objects

2014-11-09 Thread Andrei Chis
Hi all,

In order to improve object inspectors we are doing a survey. We want to
know whether several features are important to you or not when trying to
understand objects.

This is a very short survey and should't take you more than 10 minutes to
complete. Please take this time to participate.

Here is the link to the survey: http://goo.gl/forms/xKPxqLxJJv


Cheers,
Andrei


Re: [Pharo-users] Polygons in woden

2014-11-09 Thread Ronie Salgado
Hi Nicola,

Sorry for not answering before. I have to improve my mail filters.

As for the shadows, currently only the spotlights can cast shadows. I have
yet to implement shadow mapping for directional lights. As for point light,
I won't be implementing them in the near future, because they are very
expensive. Currently you can simulate a point light casting shadows by
using 6 spotlights with different orientations but in the same point.

Also, you have to use deferred shading if you need shadows
(WDFPSSimpleExample8 >> #initializeSceneRenderer)

As for the polygons, Woden cannot render arbitrary polygons. Only points,
lines, triangles and quads because that is what the graphics cards support.

For an arbitrary polygon, you have to perform some kind of triangulation.
If the polygon is convex, this is trivial, but if the polygon is concave
this is hard (the algorithm missing is a Restricted Delaunay Triangulation).

For drawing a convex polygon, you have to do something like this:

positions := "Some Collection" ..

builder newTrianglesScope.

"Add the positions".
positions do: [:i |
  builder addP: 
].

"Add the indices"
3 to: positions size do: [:i |
  builder addI1: 1 i2: i - 1 i3: i
].

What this code does is to generate a triangle fan (
http://en.wikipedia.org/wiki/Triangle_fan  ) which is a simple way to
triangulate a convex polygon.

I think that I should add a method to the geometry builder.

Greetings,
Ronie



2014-10-28 11:33 GMT-03:00 Nicolas Lusa :

> Hi everyone,
>
> I am working on some 3d representation and I am trying to draw 3D polygons
> with woden. I actually manage to make "the walls" but I still have to
> implement top and bottom parts which are not so simple since the shape can
> be really different from case to case.
> How I am actually doing it is with: WDGeometryBuilder adding vertices with
> addP:  N:  C:  TC: messages and with addQuadI1: i2: i3: i4:
> Furthermore I have some issues with the shadows which actually don't
> appear.
>
> You can see a current polygon created with the code that I made in the
> attached image. (also notice the shadows are missing as well as the bottom
> and top part of the polygon).
> [cid:E6905B6F-F5CA-447D-A42D-BA1604AC7F5A@mobile.usilu.net]
> Now my question is: is there already something that makes those polygons
> or does anyone have any hint on how to make the top part with woden?
>
> Thannks in advance.
>
> Cheers,
> Nicolas
>