First Official C++ Net Script Demo for 2.097

News, Discussions, Questions and Answers

First Official C++ Net Script Demo for 2.097

Postby thyme » 28 Apr 2006, 17:44

Seamless 2.097 is ready for download 8)

Go to the seamless home page and click on download

Last year I started writing a script compiler for Seamless something I had wanted to do for years.
Late in the year I showed a few demonstrations to a few friends of my scripts in action but the events that piled up late that year robed me of ever having an official announcement of Seamless3d supporting scripts until today :)

The scripting interface is still far from user friendly in the sense that if you make one simple mistake entering a line of code the chances are seamless with crash but the robot does demonstrate how sweet things can be and how good its all going to be in the future :)

I did wonder about postponing this announcement further but I fear to many builders are getting tired of VRML's slow development and lack of support and because of this are moving on to proprietary formats. VRML is probably still currently the most popular 3d standard for the net but with so little progress being made in the right direction to make things a lot more exciting I feel it is the right thing to do, to unveil my C++ net script demo now!


To see the demo in action go to the F10 menu and click on:

help/worm animation

This is C++ code but if you output the example as a wrl the script is converted to JavaScript and will work in blaxxun contact!

Each time a line of script is entered by the robot seamless compiles all the C++ code but this operation is fast enough for it to appear to be no different to adding a line of code for an interpreted language.

This demo is based on my online worm animation tutorial except instead of using ROUTEs and extra nodes it is done more cleanly using C++ script.
Note at one stage you see the robot inserting 4 minus signs in front of 4 SFRotations (in front of the nodes they belong to). This is the equivalent of using the standard VRML JavaScript inverse() function but instead we are taking advantage of C++'s operator overloading using a minus sign operator. This is just one example of how C++ can actually be higher level than JavaScript to code. If the smls file is output while there is a minus operator being used this way the operators are converted to inverse functions so that a current VRML browser can make sense of them.

The interface hides a few things like the C++ curly brackets the same way the scene tree interface hides the curly brackets for VRML nodes. Having a tree view to handle the indentation like this makes my C++ code appear a little like python but if you look at the script code in the smls file using a text editor you will see the familiar C style curly brackets and the semicolons (end of instruction symbol) which too are hidden from the user in the scene tree window. I may make it in the future so that the curly brackets and semicolons can be displayed as an option for C++ coders who prefer to see them. Hiding the brackets and semicolons has the advantage though of reducing clutter in the scene tree and reduces the number of symbols a beginner has to digest.

The seamless library makes the code look very much like JavaScript. Perhaps the main difference in using Seamless script for scripting to JavaScript is all the variables types must be defined because C++ is not an interpreted language its a compiled one. This does not make C++ any less high level. Although strongly typed languages run much more efficiently its not just for the computers sake why many prefer strongly typed languages. Well defined types help the programmer too especially when making radical changed to lots of code. Letting the computer interpret to much to mean just about anything you give it, does not help yourself or the computer figure out just what it is you are trying to do and can also hide bugs.

Because this compiler compiles C++ code straight into native machine code Seamless must have one of the fastest web script engines in existence.
Speed isn't just something that lets you race, it lets you try things that other wise might be put off for the fear of it being to slow and so speed has a lot to do with how versatile a languages ends up being.
There are many scripting languages based on C++ but I don't want to go down the path of designing limitations into the language so that there is little hope of a standard C++ compiler being able to compile your online scripts for offline programs. By supporting C++ there is no reinventing of the wheel for the actual language. C++ has already proved it self as a most practical and versatile language for offline content, its the most popular language in the world, most widely supported and is almost always the language of choice for 3d applications such as computer games and 3d editors. All I am trying to do here is make C++ a friendly high level safe web language through the use of a library and a helpful interface. I want the C++ net script engine and the viewer it is being developed for to be free and open source and if possible free of any trade mark the same way C++ it self is free of any trade mark.
Last edited by thyme on 07 Jun 2007, 23:13, edited 1 time in total.
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

C++ Thing

Postby miniwarrior » 05 May 2006, 01:55

I dont think many people really know what, how to use, Or any idea what C++ is it seems. But the funny thing is im learning it and im only 13 but dont start thinking im a nurd...
miniwarrior
 
Posts: 7
Joined: 22 Apr 2006, 00:31

Postby thyme » 08 May 2006, 19:30

I am glad you are learning C++ miniwarrior :)
C++ is in fact one of the most popular programming languages having stood the test of time, proving its not just a theoretical language, but a language that gets satisfying results. One of the reasons many think C++ is a more difficult language to use than a scripting language like JavaScript, is simply because it has more options and so many think it has to be more complex but the reality is when you use C++ to do the same sorts of simple things one would do using a simple scripting language, C++ looks pretty much the same as I have demonstrated here in my worm animation example. In fact because C++ supports operator overloading my example is more intuitive than what would be possible using JavaScript for Rotation types. The more options C++ has at its disposal should be a good thing also in letting one go further instead of arriving at a dead end after months of work. However instead of emphasizing the extra options to beginners, my goal is to emphasize that one need not have to do any more than for example:

nodeA.field = nodeB.field

to utilise C++ as a scripting language for 3d graphics.
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

Postby Lilly » 09 May 2006, 05:17

Bonjour thyme
je vois que tu as beaucoup travaillé
ehehe tu vas pouvoir faire un très joli bikini
pour Lilly-Sophie peut être ! :wink:

Bonne journée
bisous
Image
User avatar
Lilly
 
Posts: 1097
Joined: 22 Apr 2006, 00:10
Location: France

Postby thyme » 11 May 2006, 22:32

Dear Lilly and All Seamless Friends :)
I was hoping to have had a new version out by now demonstrating my new C++ script doing something more advanced by showing a single hoppy running over some hills. This as many know including yourself Lilly, I achieved last year but never showcased it officially because there were a few things I wanted to refine. I thought all was nearly ready just a few days ago but noticed the hoppy does not turn corners like the original I designed did. This is more noticeable when a hoppy turns a sharp corner. Looking into this more I can see now I simplified the VRML one and must have forgotten this (its about 6 years ago since I converted it). I now understand why the hopzogs legs had a noticable bug from time to time so I am pleased that mystery is now uncovered. Even though I simplified my original code I can remember it took me a week just to convert it. This was because at the time I did not understand VRML very well and I had my hoppy scaled to a different size as well as it running forward on the X axis instead of the Z axis which is the standard for avatars. This may sound to many a trivial thing to do but the hoppy code is so complex using lots of variables for X, Y and Z velocities it was far from a trivial task. It saddens me to think my hoppies have been online for 6 years and no one has ever seen them functioning to their full sophistication, except for my family and a famous Australian, Dick Smith (who landed his helicopter on our farm in 2000 (a famous person meets a recluse)). Because of this I decided a few days ago to revisit my original Hoppy code I wrote in 1999 and convert it all over again but this time I won't cut any corners and simplify it in any way. I am sure that when people see it turn a corner they will agree that it was well worth a few extra days work especially since I spent many months perfecting the hoppy in 1999. Hopefully when I have passed this milestone the downhill ride will have truly begun and will be able to take things at a easier pace, finding time for one of my favourite pursuits, making seamless bikinis :)
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

Postby Lilly » 12 May 2006, 16:01

hello thyme merci
j'espère que le hoppy va bien sauter maintenant :P
et que j'aurai un joli bikini ( mais pas un string :P )
et aussi j'aimerais pouvoir m'asseoir, car je fatigue
et me coucher aussi pour dormir dans mon beau lit rose
en coeur :wink:

bisous
Lilly
User avatar
Lilly
 
Posts: 1097
Joined: 22 Apr 2006, 00:10
Location: France


Return to Seamless3d Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron