|
| 1 | +--- |
| 2 | +title: "GSoC ’25 Week 07 Update by Aditya Kumar Singh" |
| 3 | +excerpt: "Enhanced shared mode synchronization for Tour and Doctor activities, improved scoring visualization, and camera state persistence in the 3D Human Activity." |
| 4 | +category: "DEVELOPER NEWS" |
| 5 | +date: "2025-06-30 |
| 6 | +slug: "2025-06-30-gsoc-25-AdityaKrSingh26-week07" |
| 7 | +author: "@/constants/MarkdownFiles/authors/aditya-singh.md" |
| 8 | +tags: "gsoc25,sugarlabs,week07,AdityaKrSingh26" |
| 9 | +image: "assets/Images/GSOC.png" |
| 10 | +--- |
| 11 | + |
| 12 | +<!-- markdownlint-disable --> |
| 13 | + |
| 14 | +# Week 07 Progress Report by Aditya Kumar Singh |
| 15 | + |
| 16 | +**Project:** [Sugarizer](https://github.com/llaske/sugarizer) |
| 17 | +**Mentors:** [Lionel Laské](https://github.com/llaske) |
| 18 | +**Assisting Mentors:** [Samarth Bagga](https://github.com/SamarthBagga) |
| 19 | +**Reporting Period:** 2025-06-19 - 2025-06-25 |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Goals for This Week |
| 24 | + |
| 25 | +- **Goal 1:** Implement shared mode synchronization for Tour activity |
| 26 | +- **Goal 2:** Enhance Doctor mode to show XO Icons and name with real-time scoring visualization |
| 27 | +- **Goal 3:** Persist camera zoom and orientation across sessions |
| 28 | +- **Goal 4:** Add support for side and back view positioning in Tour |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## This Week’s Achievements |
| 33 | + |
| 34 | +1. **Shared Tour Mode** |
| 35 | + - Implemented broadcast message `tourStep` carrying the part index & name; the host fires it and peers replay it to keep camera position and mesh highlight in lock-step. |
| 36 | + - Added graceful join-in-progress sync: newcomers receive the current step and camera pose on `syncAllPaintData`, so nobody is “mid-tour-lost”. |
| 37 | +  |
| 38 | + ```javascript |
| 39 | + // Broadcast tour step to other users |
| 40 | + presence.sendMessage(presence.getSharedInfo().id, { |
| 41 | + user: presence.getUserInfo(), |
| 42 | + action: "tourStep", |
| 43 | + content: { |
| 44 | + index: tourIndex, |
| 45 | + partName: part.name |
| 46 | + } |
| 47 | + }); |
| 48 | + |
| 49 | + // Sync handler |
| 50 | + function syncTourStep(index, partName) { |
| 51 | + const part = bodyParts[index]; |
| 52 | + const currentMesh = currentModel.getObjectByName(part.mesh); |
| 53 | + |
| 54 | + // Highlight mesh |
| 55 | + currentMesh.material = new THREE.MeshStandardMaterial({ |
| 56 | + color: new THREE.Color("#ffff00"), |
| 57 | + emissive: "#ffff00", |
| 58 | + emissiveIntensity: 0.2 |
| 59 | + }); |
| 60 | + |
| 61 | + // Position camera |
| 62 | + camera.position.set( |
| 63 | + part.position[0], |
| 64 | + part.position[1], |
| 65 | + part.position[2] + 5 |
| 66 | + ); |
| 67 | + camera.lookAt(part.position[0], part.position[1], part.position[2]); |
| 68 | + } |
| 69 | + |
| 70 | +2. **Shared Doctor Mode** |
| 71 | + - Re-used the Presence layer from Paint mode to emit nextQuestion / answer / scoreUpdate events. |
| 72 | + - First-correct-gets-the-point logic now lives entirely on the host |
| 73 | + - Peer-to-peer visual feedback: *correct click flashes the mesh green, wrong click red*; scores float next to each user’s XO badge |
| 74 | +  |
| 75 | +  |
| 76 | +  |
| 77 | + |
| 78 | + |
| 79 | +3. **Camera & Zoom Persistence** |
| 80 | + - Stored `cameraPosition`, `cameraTarget`, and `cameraFov` in the Journal JSON when the Stop icon is pressed. |
| 81 | + - On activity resume we restore both orbit target and FOV, giving users continuity—especially useful after deep-dive zooms into organs. |
| 82 | + ```javascript |
| 83 | + // Saving camera state |
| 84 | + function saveCameraState() { |
| 85 | + return { |
| 86 | + position: { |
| 87 | + x: camera.position.x, |
| 88 | + y: camera.position.y, |
| 89 | + z: camera.position.z |
| 90 | + }, |
| 91 | + target: { |
| 92 | + x: orbit.target.x, |
| 93 | + y: orbit.target.y, |
| 94 | + z: orbit.target.z |
| 95 | + }, |
| 96 | + fov: camera.fov |
| 97 | + }; |
| 98 | + } |
| 99 | + // Restoring camera state |
| 100 | + function restoreCameraState(state) { |
| 101 | + camera.position.set(state.position.x, state.position.y, state.position.z); |
| 102 | + orbit.target.set(state.target.x, state.target.y, state.target.z); |
| 103 | + camera.fov = state.fov; |
| 104 | + camera.updateProjectionMatrix(); |
| 105 | + orbit.update(); |
| 106 | + } |
| 107 | +
|
| 108 | +4. Side and Back View Support for Tour |
| 109 | +- Extended body part data (`organParts.json`) to include `sideView` and `frontView` flags. |
| 110 | +- Tour camera now automatically adjusts orientation: |
| 111 | + - **Side view** → +X |
| 112 | + - **Back view** → −Z |
| 113 | + - **Front view** → +Z (default) |
| 114 | +- Created adaptive camera logic in `activity.js` to interpret these flags. |
| 115 | +  |
| 116 | +  |
| 117 | +
|
| 118 | +
|
| 119 | +--- |
| 120 | +
|
| 121 | +## Key Learnings |
| 122 | +
|
| 123 | +- Three.js Camera Control: Mastered advanced camera manipulation techniques |
| 124 | +- Real-time Sync Patterns: Developed robust synchronization for 3D interactions |
| 125 | +- Educational UX: Learned principles for effective learning feedback systems |
| 126 | +
|
| 127 | +--- |
| 128 | +
|
| 129 | +## Next Week’s Roadmap |
| 130 | +
|
| 131 | +- Write Weekly Blog Post summarizing progress, screenshots, and key learnings. |
| 132 | +- Fix remaining issues for Human body mentioned in PR |
| 133 | +- Start to implement the dashboard features of the stickman activity: draw, move |
| 134 | +- Start with implementing the Frame part of the stickman activity, add a frame, remove a frame, |
| 135 | +
|
| 136 | +--- |
| 137 | +
|
| 138 | +## Acknowledgments |
| 139 | +
|
| 140 | +Thank you to my mentors, the Sugar Labs community, and fellow GSoC contributors for ongoing support. |
| 141 | +
|
| 142 | +--- |
0 commit comments