From f4e4a9b4579763066be90f27bf60963b5fea0732 Mon Sep 17 00:00:00 2001 From: Carlos H Brandt Date: Thu, 25 Feb 2021 19:37:19 +0100 Subject: [PATCH] Add Rembrandt 3d story, adjusted 3d canvas --- app/imports/ui/d3container.js | 9 +++++--- app/imports/ui/home.html | 5 +++++ app/private/mercury/rembrandt.json | 33 ++++++++++++++++++++++++++++++ app/private/moon/sinus_iridum.json | 1 + 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 app/private/mercury/rembrandt.json diff --git a/app/imports/ui/d3container.js b/app/imports/ui/d3container.js index ca788a8..4711111 100644 --- a/app/imports/ui/d3container.js +++ b/app/imports/ui/d3container.js @@ -13,13 +13,15 @@ import './utils.js'; Async function to get the story data; It is a call to the server. The map (leaflet) can only be built if/when the client gets the data right. */ -const _buildCanvas = async (body,label) => { +const _buildCanvas = async (body,label,story_data) => { await Meteor.call('getStory', {body,label}, (err, res) => { if (err) { console.log(`Something went wrong for story ${body},${label}`); } + var data = story_data['3dmodel']; var canvas = document.getElementById('api-frame'); - var uid = '184a99a8f470456cad5a2ab8cdb23a1d'; + var uid = data.uid; + console.log(`Model UID: ${uid}`); var client = new Sketchfab(canvas); client.init(uid, { success: function onSuccess(api) { @@ -92,7 +94,8 @@ Template.d3container.onRendered(() => { var BODY = currentURI.params._body; var LABEL = currentURI.params._story; var chapter = currentURI.context.hash || 0; - _buildCanvas(BODY,LABEL); + var story_data = Session.get('currentData'); + _buildCanvas(BODY,LABEL,story_data); }) // // Template.d3container.events({ diff --git a/app/imports/ui/home.html b/app/imports/ui/home.html index 594b6ae..a042af2 100644 --- a/app/imports/ui/home.html +++ b/app/imports/ui/home.html @@ -63,6 +63,11 @@

MERCURY

The Rachmaninoff crater

+

+ + The Rembrandt basin (3D) + +

diff --git a/app/private/mercury/rembrandt.json b/app/private/mercury/rembrandt.json new file mode 100644 index 0000000..6716e0a --- /dev/null +++ b/app/private/mercury/rembrandt.json @@ -0,0 +1,33 @@ +{ + "title": "Rembrandt basin", + "authors": "Riccardo Pozzobon, Luca Penasa", + "reference": "", + "planmap_id": "PM-MER-D-Rembrandt", + "3dmodel": { + "url": "https://sketchfab.com/models/d16290aac15f4f6fbb4a2827c94129af", + "uid": "d16290aac15f4f6fbb4a2827c94129af", + "sketchfab": true, + "options": { + "annotations_visible": 1, + "annotation_cycle": 5, + "annotation": 1 + } + }, + "chapters": [ + { + "title": "Overview" + }, + { + "title": "Geologic history" + }, + { + "title": "Basin infilling" + }, + { + "title": "Inner structures" + }, + { + "title": "Outer structures" + } + ] +} diff --git a/app/private/moon/sinus_iridum.json b/app/private/moon/sinus_iridum.json index 0c5c2b6..e64ca20 100644 --- a/app/private/moon/sinus_iridum.json +++ b/app/private/moon/sinus_iridum.json @@ -5,6 +5,7 @@ "planmap_id": "PM-MOO-D-YutuGPR", "3dmodel": { "url": "https://sketchfab.com/models/184a99a8f470456cad5a2ab8cdb23a1d", + "uid": "184a99a8f470456cad5a2ab8cdb23a1d", "sketchfab": true, "options": { "annotations_visible": 1,