Saturday, December 26, 2009

Collada file import in Kresetianstvo SDK

Thanks to Open Cobalt Collada file importer project, now this feature is available and in Krestianstvo SDK 1.0.1a.
So, that one could import the models in *.dae, *.kmz Collada format (for example from Google 3D Warehouse).

And then compose your space, while dragging/rotating the edit boxes with the models.

Friday, December 25, 2009

Krestianstvo SDK v1.0.1a is updated to Seaside 3.0 and Magritte 2.0

The new updated Krestianstvo SDK 1.0.1a is available for download.

It includes all recent updates from the Krestianstvo SDK 1.0a version:
  • Collaborative Curved Space Explorer with the new avatar logic
  • Seaside 3.0 (up to 24 December 2009)
  • Magritte 2.0 (up to 24 December 2009)
  • Krestianstvo XUL 3D
  • Sophie XUL 2D
  • OMeta
  • Lazy collections
  • OSC protocol support
  • Smalltalk programming on Russian
Also, I have updated the scripts for loading Seaside 3.0 and Magritte 2.0 to any Croquet based image.
Just file in them into the image:

1. Croquet-Seaside3.0-24.12.2009.st
2. Croquet-Magritte2-24.12.2009.st

------
Обновленная версия Крестьянство SDK 1.0.1a доступна для скачивания.

Включает в себя все обновления из Крестьянство SDK 1.0a:
  • Многопользовательский исследователь искривленных пространств с новой логикой Виртуального Я
  • Seaside 3.0 (24 Декабря 2009)
  • Magritte 2.0 (24 Декабря 2009)
  • Крестьянство XUL 3D
  • Sophie XUL 2D
  • OMeta
  • Ленивые коллекции (Lazy collections)
  • OSC протокол
  • Smalltalk программирование на Русском языке
Так же я подготовил сценарии для загрузки Seaside 3.0 and Magritte 2.0 в любой (практически) образ Croquet.

1. Croquet-Seaside3.0-24.12.2009.st
2. Croquet-Magritte2-24.12.2009.st

Thursday, December 17, 2009

Avatars collaboration in CCSE shared space

In the recent update, the Croquet TUserAvatarReplica logic for CCSpaceExplorer ship was presented.
It allows to see yourself ship and other user's ships, while flying in the same space at the same time.
On screen shot one's can see the two space-ships, they represents the two Croquet avatars, entered the Curved space. Physically, they are running on two different machines and controled by real users.
So, potentially there could be any number of participants, observing self rotations/translations/ actions in space as and others at the same time.

Monday, December 14, 2009

Collaborative Curved Space Explorer v1.0 on Croquet


Happy to announce, that the first version of Collaborative Curved Space Explorer - CCSE SDK 1.0a is out!
Some words about it.
Collaborative Curved Space Explorer (CCSE) - is viewed to be in future the full-featured multi-user toolbox for exploring the structure of curved spaces in 3D (based on Croquet) with real-time rendering in curved spaces. Jeff Weeks originally developed (and continue developing now) the application Curved Spaces for exploring and rendering curved spaces in real-time using C language. CCSE is actually the port of it main part into Smalltalk and Croquet. Thus it allows to run complex time-based simulations and achieve a very deep level of collaborative interactions.

The library of the spaces is included, but more spaces could be generated with SnapPea application, suited for creating and studying 3-manifolds.

CCSE is pure Smalltalk, FFI is used only in OpenGL part, which means, that it is highly dynamical, allowing to do any changes to the code just at runtime.

Features in the version:

- Rendering of curved spaces in Croquet
- 3D Stereo (anaglyph) support viewing
- Shaders support (only Mac OS X for now)

The CCSE consists mostly of code. The needed file resources are just the preview images of spaces needed for the UI (resources).

Mainly it is developed under the Krestianstvo project and included in it's update stream.
Download the latest distribution (on Russian)



The English source code repository, Open Croquet distributions compatible is here:
http://jabberwocky.croquetproject.org:8889/CCurvedSpaceExplorer
Ready-to-go image with contents (Croquet 1.0.25 SDK)
Download


For Open Cobalt support check the repository:
http://croquet-src-01.oit.duke.edu:8886/CurvedSpacesInCobalt
Ready-to-go image with contents (OpenCobalt-1.0alpha1rc26)
Download



Thanks and happy exploring!

Thursday, November 05, 2009

Smalltalk Sophie XUL in 3D for Croquet / Krestianstvo space description - разметка пространства в 3D

In this post I want to show, how the Sophie's 1.x (the true project, based on Smalltalk and not Java's one) XUL 2D logic for describing Tweak interfaces, could be used for describing 3D content of the Croquet spaces naturally.
Now it is included in Krestianstvo SDK, as XUL 3D feature.
To try out and to extend for the concrete needs, check for the recent updates from the SDK.

1. So, one could describe the content in plain XML file/string, like:
КрестьянствоБиблиотека class>>примерXUL3DSpacexml

^'<?xml version="1.0"?>
<krestianstvo3D>
<space name="mySpace">
<imageWindow name="one" src ="checker.png" x="-10" y="0" z="-5"/>
<imageWindow name="two" src ="checker.png" x="10" y="0" z="-5"/>
</space>
<imageWindow name="three" src ="checker.png" x="-10" y="0" z="-5"/>
<space name="mySpaceA">
<imageWindow name="some" src ="checker.png" x="-10" y="0" z="-5"/>
<imageWindow name="other" src ="checker.png" x="10" y="0" z="-5"/>
</space>
<!-- ..etc... -->
</krestianstvo3D>'
2. Then this file is parsed into the real objects, node by node:
Крестьянство3DXulЗагрузчик>>readXmlFrom: xmlNode

|tframeClass tframe|

tframeClass := self croquetFrames at: xmlNode name ifAbsent:[nil].
tframeClass ifNotNil:[tframe := tframeClass new readXmlFrom: xmlNode in: self.].

^tframe
3. Every XML node is parsed according to the methods defined in Крестьянство3DXulЗагрузчик class, for example 'imageWindow' is parsed as TWindow instance:
Крестьянство3DXulЗагрузчик>>readWindowFrame: aFrame from: xmlNode

| attr pic p attrX attrY attrZ matNorm |

(attr := xmlNode attributeAt: 'name') ifNotNil:[
nodeAttributes remove:'name'.
aFrame objectName: attr asSymbol.
].

(attr := xmlNode attributeAt: 'src') ifNotNil:[
nodeAttributes remove:'src'.

p := TRectangle new.
aFrame contents: p.

(attr asString) ifNotNil:[
pic := TTexture new.
pic initializeWithFileName: (attr asString)
mipmap: true
shrinkFit: false.
].
p texture: pic.
aFrame extent: pic extent.].
matNorm := TMaterial new.
matNorm ambientColor: #(0.8 0.8 0.8 0.8).
matNorm diffuseColor: #(0.8 0.8 0.8 0.8).
aFrame rectFront material: matNorm.

"...........ect......"
4. In TWindow class (or any other needed TFrame subclass) we add the method, which points to the method to parse the XML node with:
TWindow>>readFrame3DSpecificFrom: xmlNode in: uiLoader

super readFrame3DSpecificFrom: xmlNode in: uiLoader.
uiLoader readWindowFrame: self from: xmlNode
5. All, recognizable names of XML tags are defined in :
Крестьянство3DXulЗагрузчик class>>croquetFrames

^Dictionary newFrom:
{
#imageWindow ->TWindow.
#space ->TSpace.
#window -> TWindow.
#portal -> TPortal;
"any other stuff"
}
6. Finally, the created instances are serialized on to the shared island:
КрестьянствоОснова>>addTFToSpace: aFrame space: aSpace

| frameData tframe |

frameData := TIslandCopier new export: aFrame.
tframe := TIslandCopier new import: frameData to: self activeIsland.
tframe := aFrame copyOntoIsland: self activeIsland.

tframe future registerGlobal: aFrame objectName.
aSpace future addChild: tframe.
..and appeared in the World for collaborative interaction..


As a note: the Tweak menu bar on the top of the Participant window is described using the native Sophie's XUL 2D logic also.

Thursday, October 01, 2009

self = я or programming / программирование in Krestianstvo


EN: Just want to show, how Russian language is already could be used to program in Smalltalk using Krestianstvo.
Here is a program for building L-systems and drawing them with Pen or any other Object later in Smalltalk (for example Croquet's TObjects in OpenGL).
You will see some fragments of source code in Russian - all are the executable Smalltalk code. The whole version is available here (also it is available in update stream). The changeset (*.cs) or source code (*.st) files, which could contain Unicode symbols (russian here), could be exported or imported into the Krestianstvo system without any trouble.

RU: Представляю вашему вниманию пример, показывающий как уже сейчас можно программировать в среде Крестьянство на Smalltalk используя Русский язык. Мы запрограммируем алгоритм пострения L - систем и их рисования с помощью Карандаша или других объектов в дальнейшем (например Croquet TObjects в OpenGL).
Ниже приведены фрагменты исполняемого кода, полная версия доступна для скачивания здесь (так же в потоке обновлений для системы). Файлы изменений (*.cs) или исходного кода (*.st), содерджащие символы Unicode (в данном случае - русские), могут экспортироваться или импортироваться в систему Крестьянство без ошибок.

Smalltalk in Russian/ Smalltalk'а по Русски
self = я
to: do: = по: делай:
at: = в:
at: put: = в: значение:
ifNotNil:[] = еслиНеПусто:[]
ifTrue:[] = еслиИстина:[]
or:[] = или:[]

L - система (code fragments)/(фрагменты кода)

1. Объявление класса / Creating the class:
Объект подкласс: #ЛСистема
именаПеременныхЭкземпляраКласса: 'предложение наборПравил генерация'
именаПеременныхКласса: ''
глобальныеСловари: ''

категория: 'Математика-ЛСистемы'

3. Метод инициализаци / Initialization
ЛСистема>>определитьЛСистемуАксиома: аксиома наборПравил: набор

я предложение: аксиома.
я наборПравил: набор.
я генерация: 0.

2. Определение метода генерации / Defining the generation method:
ЛСистема>>генерировать

| текущийСимвол строкаЗамены заменаИзПравил следующаяГенерация |

следующаяГенерация := ''.
1 по: предложение размер делай:[:индекс|

текущийСимвол := (предложение в: индекс) какСтрока.
строкаЗамены := '',текущийСимвол.

заменаИзПравил := (я искатьИзНабораПравил: текущийСимвол).
заменаИзПравил еслиНеПусто:[ строкаЗамены := заменаИзПравил].

следующаяГенерация := следующаяГенерация, строкаЗамены.
].

предложение := следующаяГенерация.

генерация := генерация + 1.

4. Рисование / Painting:

ЛСистема>>нарисовать

| символ карандаш длинаЛинии уголПоворота |

карандаш := Карандаш новый.

длинаЛинии := 20.
уголПоворота := 60.

1 по: предложение размер делай:[:индекс|

символ := (предложение в: индекс) какСтрока.

((символ = 'F') или:[ (символ = 'G')]) еслиИстина:[

карандаш иди: длинаЛинии.

].

(символ = '+') еслиИстина:[

карандаш повернуть: уголПоворота.

].

(символ = '-') еслиИстина:[

карандаш повернуть: (-1) * уголПоворота.

].

].


5. Выполнение / Executing:

ЛСистема класс>>примерПостроенияЛСистемыСерпинский

| правила лСистема |

правила := Массив новый: 2.
правила в: 1 значение: ((ЛСистемаПравило новый) определитьПравило: 'F' строка: 'F--F--F--G').
правила в: 2 значение: ((ЛСистемаПравило новый) определитьПравило: 'G' строка: 'GG').

лСистема := (ЛСистема новый) определитьЛСистемуАксиома: 'F--F--F' наборПравил: правила.

"генерировать 5 раз"

1 по: 5 делай:[:i|
лСистема генерировать.
].
лСистема нарисовать.

Wednesday, September 16, 2009

Krestianstvo SDK - Smalltalk | Croquet | Seaside... programming on Russian

Introducing Krestianstvo SDK

Krestianstvo SDK is built on top of OpenCroquet SDK with preloaded packages (some of the list: Sophie XUL-CSS, Seaside, OMeta, and Krestianstvo itself).



From now it will be entirely native spoken language based (Russian). This means that all String's objects and the sources of the methods, selectors, class names, etc. will be translated (as possible), moving forward SDK to fully functional modern programming environment accessible to people of all ages, without forcing them to learn English to program.


All new source code will be written on native spoken language (Russian), as possible also.
The SDK is updated through change set's update stream and source code could be easily filed in/filed out containing unicode chars.



The current developed version of the Krestianstvo SDK could be downloaded here (one-click image for Windows, Linux, Mac OS X).



Представляем вашему вниманию открытый проект Крестьянство SDK.
Наконец-то, стало возможным программирование в SmallTalk, Croquet, Seaside на родном языке (Русском).
Мы еще только в начале пути, но тем неменее уже доступен для скачивания базовый образ для основных платформ (Windows, Linux, Mac OS X).

Крестьянство SDK построен на основе OpenCroquet SDK с предустановленными пакетами (некоторые из списка: Sophie XUL-CSS, Seaside, OMeta и Крестьянство).
Отныне она будет разрабатываться полностью на родном языке (русский).
Крестьянство обновляется путем потока изменений и исходный код может быть легко (загружаться в/ выгружаться из) образа приложения.

Текущий вариант Крестьянство SDK можно загрузить здесь.

Thursday, July 23, 2009

Live and collaborative coding in Croquet


Open Croquet and Cobalt SDK are built on top of the Squeak self-exploratory environment, where everything could be modified/inspected in real time. It means that the environment is just created for live coding and interactive programming in SmallTalk.

Everything is OK, when you use just one computer with only one running vm/image on it (default for Squeak programming model).
But, Croquet/Cobalt were built for creating replicated 3D environments, which are distributed over the network, and several vm's/images running at the same time define the Island.
And so, for saving the identity of replicas of the shared Island, nobody from the participants couldn't change anything in the code in the local images. They are allowed just modify parameters had been programed earlier, or update their images using changeSets, Monticello etc. or just copy/paste the whole image.
But, if we want to program on the Island in all replicas at the same time?
For example it is often needed, when you have already run several images defining Island, but need to modify something in code, without stopping everything.
Or for collaborative coding between several programmers at the same time, forming one image, but working on it's replicas, being at different places.

The feature is missed in the current Croquet SDK (may be XPForums project for collaborative programming using Croquet will solve this, but it is closed yet).

So, as proof of "live coding" concept in Croquet we could do the following:

1. Create the new TObject or TFrame subclass, with instance method like:

TLiveCode>> compileMethod: aCodeString inClass: aClassName

Utilities authorInitialsPerSe isEmpty ifTrue:[ Utilities setAuthorInitials: 'sn'].
aClassName compile: aCodeString.


2. Add this object into the existed island (or register during initialization):

liveCodeFrame := self harness activeIsland future new: TLiveCode.
liveCodeFrame future registerGlobal: #liveCoding.

3. Then add instance method to the used harness class, like:

CroquetHarness>> makeMethodInFuture: aCodeString inClass: aClassName

| liveCodeFrame|

liveCodeFrame := self activeIsland future at: #liveCode.
liveCodeFrame whenResolved:[
liveCodeFrame futureDo: #compileMethod:inClass: at:0 args: {aCodeString. aClassName}
].

The calling of this method on any participant will leads to the equal modification of the source code in all connected Island replicas.

This proof of concept code for Croquet/Cobalt image can be downloaded here.
Experimental Seaside based ClassBrowser with support for live coding in Croquet island directly from web-browser is here (the Croquet-Seaside 2.9 imge and above code is needed to run).

Next steps could be the development of corresponding tools using existed SystemBrowser or OmniBrowser for full support of live coding/collaborative programming in the shared Islands.

Monday, July 13, 2009

Seaside 2.9 and Comet to control replicated Croquet islands.

I want to share some of my experiments in combination of Open Croquet and Seaside/Comet at image level.

The main aim is: to allow multi-user interactions with shared content on the Croquet island just from web browser in real time (from any place, device like smart-phone, low-end machine (sometimes without OpenGL) etc. so, that a connection to the network and http web based browser just needed.
Also, it could help to implement open source "Forum pages" like features , which are existed only in Qwaq forums 2.0 (access recent activity from your web browser etc.).

I have prepared the ready-to-go image for those, who want to explore the infinite possibilities :)
1. CroquetSDK.v1.0.18 with new image.
2. Just one image for using with manual downloaded any Croquet SDK.

Also, I prepared the Script for loading Seaside 2.9 alpha updated (13-07-09) into any fresh OpenCroquet image (1.0.18 users should update from sources to the latest, or use this one Croquet.1.0.25 )

For examples look at SmotriniWorldControl class.


Here on the screen-shot there are two participants and two opened web browsers (Safari, Firefox).
Just only one participant run Seaside/Comet application.
Changing any of the RGB sliders (in one of browser window) causes the change of the active space color, and glad to Comet in all opened Web browsers slider's handles change their visual state automatically (without manual refreshing).

All callbacks from seaside to croquet island are future events, like from proper harness in Croquet, so they dose not destroy the replicated state.
-----
onSlide: (html jQuery ajax
callback: [ :value |
aColor = #red ifTrue:[self class valueRGB red: value asNumber.
aFrame future color: (Color r: self class valueRGB red g: aFrame color green b: aFrame color blue)].
-----

How to run:

1. Start WAListenerAdaptor (support Comet Seaside applications)

WAListenerAdaptor startOn: 8888. (different ports for several participants, if needed)

2. Open Croquet master (KAT Demo harness is used in this example, from default Croquet SDK).

KCroquetParticipant new openInWorld.

When it asks about interactivity server, leave it blank, as (www.croquetcollaborative.org) could not work, so it will start locally.

3. Point your any web browser (Firefox, Safari preferable) to:

http://localhost:8888/seaside/croquet

4. To test Comet functions (RGB Slider), just open another browser window and point it also to:

http://localhost:8888/seaside/croquet


To be continued..