problem with "becomepart" in wonderland

Remi Sussan rsussan at noos.fr
Wed Oct 15 12:23:12 UTC 2003


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-dev/attachments/20031015/37b977d6/withoutbecomepart.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-dev/attachments/20031015/37b977d6/withbecomepart.jpg


More information about the Squeak-dev mailing list