{"id":5387,"date":"2024-11-30T17:17:24","date_gmt":"2024-11-30T17:17:24","guid":{"rendered":"https:\/\/castle-engine.io\/wp\/?p=5387"},"modified":"2024-11-30T17:17:24","modified_gmt":"2024-11-30T17:17:24","slug":"in-progress-web-target-ifc-mormot-sample","status":"publish","type":"post","link":"https:\/\/castle-engine.io\/wp\/2024\/11\/30\/in-progress-web-target-ifc-mormot-sample\/","title":{"rendered":"In progress: web target, IFC, mORMot sample"},"content":{"rendered":"<table class=\"thumbnails thumbnails-align-right\"><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/web_platformer.png\"\n             class=\"screenshot\"\n             title=\"Web target - initial logs\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/web_platformer-200x93.png\"\n             width=\"200\" height=\"93\" \n            alt=\"Web target - initial logs\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/example_ifc.png\"\n             class=\"screenshot\"\n             title=\"IFC example\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/example_ifc-200x119.png\"\n             width=\"200\" height=\"119\" \n            alt=\"IFC example\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/mormot_screenshot1.png\"\n             class=\"screenshot\"\n             title=\"mORMot and Castle Game Engine\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/mormot_screenshot1-200x117.png\"\n             width=\"200\" height=\"117\" \n            alt=\"mORMot and Castle Game Engine\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/mormot_screenshot2.png\"\n             class=\"screenshot\"\n             title=\"mORMot and Castle Game Engine\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/mormot_screenshot2-200x117.png\"\n             width=\"200\" height=\"117\" \n            alt=\"mORMot and Castle Game Engine\"\n          ><\/a><\/td><\/tr><\/table>\n<p>This post contains a relatively unimpressive screenshot that actually shows a very important achievement \ud83d\ude42<\/p>\n<p>Things we are working on right now in <a href=\"https:\/\/castle-engine.io\/\">Castle Game Engine<\/a>:<\/p>\n<ol>\n<li><a href=\"https:\/\/castle-engine.io\/web\">Web target<\/a>.\n<p>Yes, it means what you think \ud83d\ude42 Just recompile any Castle Game Engine project to run in a modern WWW browser! No plugins of course, it&#8217;s using JS + WebAssembly, it just works.<\/p>\n<p>What we have: We have a CGE branch with <em>build tool<\/em> that can execute <code>castle-engine compile --target=web<\/code> and then <code>castle-engine run --target=web<\/code> to:<\/p>\n<ul>\n<li>build a wrapper using <a href=\"https:\/\/getpas2js.freepascal.org\/\">Pas2js<\/a>,<\/p>\n<\/li>\n<li>\n<p>then build your game using <a href=\"https:\/\/wiki.freepascal.org\/WebAssembly\">FPC for WebAssembly<\/a>,<\/p>\n<\/li>\n<li>\n<p>generate skeleton HTML file with <code>&lt;canvas&gt;<\/code> element,<\/p>\n<\/li>\n<li>\n<p>run a HTTP server (just <code>compileserver<\/code> from pas2js, on port 3000),<\/p>\n<\/li>\n<li>\n<p>run a WWW browser to open <code>http:\/\/localhost:3000\/<\/code> and execute Pas2js-generated JavaScript that in turn runs the WebAssembly code.<\/p>\n<\/li>\n<li>\n<p>The WebAssembly code initializes log (you will see typical CGE log messages in both the browser console and in HTML content), and then opens <code>TCastleWindow<\/code> with a special WebAssembly backend&#8230;<\/p>\n<\/li>\n<li>\n<p>&#8230;and, nothing more yet \ud83d\ude42 TODO: We fail at the moment we want to use <code>glGetString<\/code>. Next steps are known, we need to use WebGL from WebAssembly, and the way to do this seems to use <code>TJSWebGL2RenderingContext<\/code> from <code>job_web<\/code>. Stay tuned!<\/p>\n<\/li>\n<\/ul>\n<p>More information (what we have, what we plan) on the <a href=\"https:\/\/castle-engine.io\/web\">dedicated web target docs<\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/castle-engine.io\/ifc\">IFC (Industry Foundation Classes) format support<\/a>.<\/p>\n<p>It&#8217;s &#8220;another 3D model format&#8221;, ISO standard, that we support. It defines useful concepts for architecture, construction and engineering use-cases. It cooperates with some known applications in the domain, like <em>Revit<\/em>, <em>ArchiCAD<\/em>, <a href=\"https:\/\/bonsaibim.org\/\">BonsaiBIM in Blender<\/a>, <a href=\"https:\/\/www.freecad.org\/\">FreeCAD<\/a> and many others. It defines concepts useful for building real-world stuff &#8212; the things defined are not only displayed in 3D, they may also have plans, they may have costs, scheduling and other metadata useful for real people making it.<\/p>\n<p>It&#8217;s also quite special &#8212; we provide dedicated API for it, using IFC classes, to load (or build from scratch), save and modify IFC models.<\/p>\n<p>A lot of basics work already. The IFC models can be loaded, modified and saved. We have <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/tree\/master\/examples\/ifc\">examples\/ifc<\/a> that shows this.<\/p>\n<p>TODO: We work on making it now &#8220;as complete as possible (though without CSG and NURBS)&#8221;.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/castle-engine\/castle-and-mormot-collaborative-editing\/\">Collaborative editing of 3D world using Castle Game Engine and mORMot2<\/a>.<\/p>\n<p>This is a new example using our engine and <a href=\"https:\/\/github.com\/synopse\/mORMot2\/\">mORMot 2<\/a>.<\/p>\n<p>It shows already how you can modify and render a 3D world using our engine, and send the world information to a server made usign mORMot 2. The server synchronizes world state to a database on disk.<\/p>\n<p>TODO: The missing feature is &#8220;collaborative editing&#8221; promised there. Right now actually changes from other users are <em>not<\/em> synchronized as I envisioned.<\/p>\n<\/li>\n<\/ol>\n<p>Have fun with <em>Castle Game Engine<\/em>! And if you like what we do &#8212; <a href=\"https:\/\/castle-engine.io\/donate\">please support us<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post contains a relatively unimpressive screenshot that actually shows a very important achievement \ud83d\ude42 Things we are working on right now in Castle Game Engine: Web target. Yes, it means what you think \ud83d\ude42 Just recompile any Castle Game Engine project to run in a modern WWW browser! No plugins of course, it&#8217;s using &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/castle-engine.io\/wp\/2024\/11\/30\/in-progress-web-target-ifc-mormot-sample\/\" class=\"more-link\">Continue reading  \u27a4<span class=\"screen-reader-text\"> &#8220;In progress: web target, IFC, mORMot sample&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":5389,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"publish_to_discourse":"1","publish_post_category":"9","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"5446","discourse_permalink":"https:\/\/forum.castle-engine.io\/t\/in-progress-web-target-ifc-mormot-sample\/1445","wpdc_publishing_response":"","wpdc_publishing_error":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-5387","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2024\/11\/web_platformer.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9IgYW-1oT","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/5387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/comments?post=5387"}],"version-history":[{"count":12,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/5387\/revisions"}],"predecessor-version":[{"id":5403,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/5387\/revisions\/5403"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media\/5389"}],"wp:attachment":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media?parent=5387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/categories?post=5387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/tags?post=5387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}