[Squeak-fr] un premier rapport wonderland

Remi Sussan rsussan at noos.fr
Dim 15 Aou 14:26:18 CEST 2004


En exemple d'un premier "rapport" sur les problemes wonderland, je renvoie
ici mon courrier de  2003 à la squeak-dev. Non pas pour recevoir une réponse
(le probleme est assez tordu, j'en conviens, mais fondamental, car il remet
en question le systeme de hierarchie d'objets de Wonderland et risque, si je
ne me suis pas trompé et s'il n'y a pas de solution, d'invalider toute
création un sophistiquée avec ce systeme), mais juste en contribution au
groupe ! De plus, c'est un exemple d'utilisation un peu complexe de
Wonderland, en dehors de la fenêtre script, cela peut donc faire office de
petit tutoriel sur le sujet (mais un tutoriel qui echoue à la fin!)

Remi
----- Original Message ----- 
From: "Remi Sussan" <rsussan at noos.fr>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Wednesday, October 15, 2003 2:23 PM
Subject: problem with "becomepart" in wonderland


> Hello,
> I'm trying to create complex objects in wonderland (outside the script
> window). I try to create two simple objects from primitives, then
associate
> them in a complex object, and try to scale this complex object. But I seem
> to have a problem with the "becomePart" instruction.
> If I try to write the following code:
>
> w_Wonderland new.
> w makeActorFromVRML:'vrml\boule.wrl' named:'maboule'.
> (w getNamespace at:'maboule') move:#up.
> w makeActorFromVRML:'vrml\cylindre.wrl' named:'colonne'.
> w makeActorNamed:'colonnade'.
> (w getNamespace at:'maboule') becomeChildOf:(w getNamespace
at:'colonnade').
> (w getNamespace at:'colonne') becomeChildOf:(w getNamespace
at:'colonnade').
>
> Then go on the script window, select in the list at the left the actors
> "maboule" and "colonne", and specify "become Part" in the pop-up menu,then
> go back to the workspace and write:
>
> (w getNamespace at:'colonnade') setSize:{0.5. 0.5. 0.5.}
>  the scaling is working perfectly (image:withoutbecomepart.jpg).
>
> But, as I want to do all through an external program, I therefore write
the
> following lines:
>
> w_Wonderland new.
> w makeActorFromVRML:'vrml\boule.wrl' named:'maboule'.
> (w getNamespace at:'maboule') move:#up.
> w makeActorFromVRML:'vrml\cylindre.wrl' named:'colonne'.
> w makeActorNamed:'colonnade'.
> (w getNamespace at:'maboule') becomeChildOf:(w getNamespace
> at:'colonnade');becomePart.
> (w getNamespace at:'colonne') becomeChildOf:(w getNamespace
> at:'colonnade');becomePart.
>
> (w getNamespace at:'colonnade') setSize:{0.5. 0.5. 0.5.}
>
> (please note an associated problem. If I try to write :"(w getNamespace
> at:'maboule') becomePart" in a single instruction, I have an error: "key
not
> found"; that's why I combine becomeChildOf and BecomePart on a single
line).
>
> After executing this code, a "scaling" occurs, but now, the two simple
> actors are scaled separately (meaning that the correct distance between
the
> two objects is lost: see image withbecomepart.jpg).
>
> If I completely suppress "becomePart", the scaling of the complex object
> doesn't occur, of course..
>
> How can I correct this strange behavior? By the way, is there somewhere
some
> code using wonderland in an advanced way?
>
> thanks!
> Remi
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: withoutbecomepart.jpg
Type: image/jpeg
Size: 2938 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-fr/attachments/20040815/d4e43c41/withoutbecomepart-0001.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: withbecomepart.jpg
Type: image/jpeg
Size: 2791 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-fr/attachments/20040815/d4e43c41/withbecomepart-0001.jpg


Plus d'informations sur la liste de diffusion Squeak-fr