Skip to content

Commit

Permalink
Add Rembrandt 3d story, adjusted 3d canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
chbrandt committed Feb 25, 2021
1 parent 83f5c3f commit f4e4a9b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/imports/ui/d3container.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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({
Expand Down
5 changes: 5 additions & 0 deletions app/imports/ui/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ <h3 style="color: #d8a89a;"><strong>MERCURY</strong></h3>
<strong>The Rachmaninoff crater</strong>
</a>
</p>
<p style="font-size:18px; font-family: 'Open Sans', sans-serif;">
<a href="mercury/rembrandt" title="The Rembrandt basin">
<strong>The Rembrandt basin (3D)</strong>
</a>
</p>
</div>

<!-- MARS -->
Expand Down
33 changes: 33 additions & 0 deletions app/private/mercury/rembrandt.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
1 change: 1 addition & 0 deletions app/private/moon/sinus_iridum.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f4e4a9b

Please sign in to comment.