Skip to content

Commit 14d19a3

Browse files
authored
Merge pull request #2464 from IIIF/uc08_3d_comments_with_cameras
Adding uc08_3d_comments_with_cameras.json
2 parents d3f821b + 26635ad commit 14d19a3

2 files changed

Lines changed: 238 additions & 134 deletions

File tree

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
{
2+
"@context": "http://iiif.io/api/presentation/4/context.json",
3+
"id": "https://iiif.io/api/presentation/4.0/example/uc08_3d_comments_with_cameras.json",
4+
"type": "Manifest",
5+
"label": {
6+
"en": [
7+
"Whale Cranium and Mandible with Dynamic Commenting Annotations and Custom Per-Anno Views"
8+
]
9+
},
10+
"items": [
11+
{
12+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1",
13+
"type": "Scene",
14+
"label": {
15+
"en": [
16+
"A Scene Containing a Whale Cranium and Mandible"
17+
]
18+
},
19+
"items": [
20+
{
21+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1/page/1",
22+
"type": "AnnotationPage",
23+
"items": [
24+
{
25+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno/1",
26+
"type": "Annotation",
27+
"motivation": [
28+
"painting"
29+
],
30+
"body": {
31+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno/1/body",
32+
"type": "SpecificResource",
33+
"source": {
34+
"id": "https://fixtures.iiif.io/3d/smithsonian/whale/whale_mandible.glb",
35+
"type": "Model",
36+
"label": {
37+
"en": [
38+
"mandible"
39+
]
40+
},
41+
"format": "model/gltf-binary"
42+
},
43+
"transform": [
44+
{
45+
"type": "ScaleTransform",
46+
"x": 10,
47+
"y": 10,
48+
"z": 10
49+
},
50+
{
51+
"type": "RotateTransform",
52+
"x": 12.5,
53+
"y": 0,
54+
"z": 0
55+
},
56+
{
57+
"type": "TranslateTransform",
58+
"x": 0,
59+
"y": 0,
60+
"z": 0.5
61+
}
62+
]
63+
},
64+
"target": {
65+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1",
66+
"type": "Scene"
67+
}
68+
},
69+
{
70+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno-that-paints-desired-camera-to-view-tooth",
71+
"type": "Annotation",
72+
"motivation": [
73+
"painting"
74+
],
75+
"behavior": [
76+
"hidden"
77+
],
78+
"body": {
79+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/cameras/1",
80+
"type": "PerspectiveCamera",
81+
"label": {
82+
"en": [
83+
"Perspective Camera Pointed At Front of Cranium and Mandible"
84+
]
85+
},
86+
"fieldOfView": 50.0,
87+
"near": 0.10,
88+
"far": 2000.0
89+
},
90+
"target": {
91+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno/2/target",
92+
"type": "SpecificResource",
93+
"source": {
94+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1",
95+
"type": "Scene"
96+
},
97+
"selector": [
98+
{
99+
"type": "PointSelector",
100+
"x": 0.0,
101+
"y": 0.15,
102+
"z": 0.75
103+
}
104+
]
105+
}
106+
},
107+
{
108+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno2",
109+
"type": "Annotation",
110+
"motivation": [
111+
"painting"
112+
],
113+
"body": {
114+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno/3/body",
115+
"type": "SpecificResource",
116+
"source": {
117+
"id": "https://fixtures.iiif.io/3d/smithsonian/whale/whale_cranium.glb",
118+
"type": "Model",
119+
"label": {
120+
"en": [
121+
"cranium"
122+
]
123+
},
124+
"format": "model/gltf-binary"
125+
},
126+
"transform": [
127+
{
128+
"type": "ScaleTransform",
129+
"x": 10,
130+
"y": 10,
131+
"z": 10
132+
},
133+
{
134+
"type": "TranslateTransform",
135+
"x": 0,
136+
"y": 1.5,
137+
"z": 0
138+
}
139+
]
140+
},
141+
"target": {
142+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1",
143+
"type": "Scene"
144+
}
145+
}
146+
]
147+
}
148+
]
149+
}
150+
],
151+
"annotations": [
152+
{
153+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1/annotations/page/1",
154+
"type": "AnnotationPage",
155+
"items": [
156+
{
157+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/commenting-anno-for-mandibular-tooth",
158+
"type": "Annotation",
159+
"motivation": [
160+
"commenting"
161+
],
162+
"body": {
163+
"type": "TextualBody",
164+
"value": "Mandibular tooth"
165+
},
166+
"target": {
167+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/comment/1/target",
168+
"type": "SpecificResource",
169+
"source": {
170+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1",
171+
"type": "Scene"
172+
},
173+
"selector": [
174+
{
175+
"type": "PointSelector",
176+
"x": -0.447287,
177+
"y": 0.546212,
178+
"z": 1.795195
179+
}
180+
]
181+
}
182+
},
183+
{
184+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/commenting-anno-for-right-pterygoid-hamulus",
185+
"type": "Annotation",
186+
"motivation": [
187+
"commenting"
188+
],
189+
"body": {
190+
"type": "TextualBody",
191+
"value": "Right pterygoid hamulus"
192+
},
193+
"target": {
194+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/comment/2/target",
195+
"type": "SpecificResource",
196+
"source": {
197+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/scene/1",
198+
"type": "Scene"
199+
},
200+
"selector": [
201+
{
202+
"type": "PointSelector",
203+
"x": -0.442066,
204+
"y": 0.671795,
205+
"z": 1.288055
206+
}
207+
]
208+
}
209+
},
210+
{
211+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno9",
212+
"type": "Annotation",
213+
"motivation": [
214+
"activating"
215+
],
216+
"target": {
217+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/commenting-anno-for-mandibular-tooth",
218+
"type": "Annotation"
219+
},
220+
"body": {
221+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/comment/3/body",
222+
"type": "SpecificResource",
223+
"source": {
224+
"id": "https://iiif.io/api/presentation/4.0/example/uc08/3d/anno-that-paints-desired-camera-to-view-tooth",
225+
"type": "Annotation"
226+
},
227+
"action": [
228+
"show",
229+
"enable",
230+
"select"
231+
]
232+
}
233+
}
234+
]
235+
}
236+
]
237+
}

source/presentation/4.0/index.md

Lines changed: 1 addition & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -761,141 +761,8 @@ It is important to be able to position the textual body of an annotation within
761761

762762
It is possible to associate a particular camera with a particular commenting annotation via activating annotations. In many complex 3D Scenes, it may not be clear from where to look at a particular point of interest. The view may be occluded by parts of the model, or other models in the Scene. In the following example, the user can explore the Scene freely, but when they select a particular comment, a specific Camera that was previously hidden (unavailable to the user) is shown, enabled, and selected. The selected Camera is now the active Camera, and the viewport into the Scene is moved to a chosen position suitable for looking at the point of interest.
763763

764+
{% include code_example.html src="uc08_3d_comments_with_cameras.json" %}
764765

765-
```jsonc
766-
{
767-
"id": "https://example.org/iiif/3d/whale_comment_scope_content_state.json",
768-
"type": "Manifest",
769-
"label": { "en": ["Whale Cranium and Mandible with Dynamic Commenting Annotations and Custom Per-Anno Views"] },
770-
"items": [
771-
{
772-
"id": "https://example.org/iiif/scene1/page/p1/1",
773-
"type": "Scene",
774-
"label": { "en": ["A Scene Containing a Whale Cranium and Mandible"] },
775-
"items": [
776-
{
777-
"id": "https://example.org/iiif/scene1/page/p1/1",
778-
"type": "AnnotationPage",
779-
"items": [
780-
{
781-
"id": "https://example.org/iiif/3d/anno1",
782-
"type": "Annotation",
783-
"motivation": ["painting"],
784-
"body":
785-
{
786-
"id": "https://raw.githubusercontent.com/IIIF/3d/main/assets/whale/whale_mandible.glb",
787-
"type": "Model"
788-
},
789-
"target":
790-
{
791-
// SpecificResource with PointSelector
792-
}
793-
},
794-
{
795-
"id": "https://example.org/iiif/3d/anno-that-paints-desired-camera-to-view-tooth",
796-
"type": "Annotation",
797-
"motivation": ["painting"],
798-
"behavior": ["hidden"],
799-
"body":
800-
{
801-
"id": "https://example.org/iiif/3d/cameras/1",
802-
"type": "PerspectiveCamera",
803-
"label": {"en": ["Perspective Camera Pointed At Front of Cranium and Mandible"]},
804-
"fieldOfView": 50.0,
805-
"near": 0.10,
806-
"far": 2000.0
807-
},
808-
"target":
809-
{
810-
"type": "SpecificResource",
811-
"source": {
812-
"id": "https://example.org/iiif/scene1",
813-
"type": "Scene"
814-
},
815-
"selector": [
816-
{
817-
"type": "PointSelector",
818-
"x": 0.0, "y": 0.15, "z": 0.75
819-
}
820-
]
821-
}
822-
},
823-
{
824-
"id": "https://example.org/iiif/3d/anno2",
825-
"type": "Annotation",
826-
"motivation": ["painting"],
827-
"body":
828-
{
829-
"id": "https://raw.githubusercontent.com/IIIF/3d/main/assets/whale/whale_cranium.glb",
830-
"type": "Model"
831-
},
832-
"target":
833-
{
834-
// SpecificResource with PointSelector
835-
}
836-
}
837-
]
838-
}
839-
]
840-
}
841-
],
842-
"annotations": [
843-
{
844-
"id": "https://example.org/iiif/scene1/page/p1/annotations/1",
845-
"type": "AnnotationPage",
846-
"items": [
847-
{
848-
"id": "https://example.org/iiif/3d/commenting-anno-for-mandibular-tooth",
849-
"type": "Annotation",
850-
"motivation": ["commenting"],
851-
"body":
852-
{
853-
"type": "TextualBody",
854-
"value": "Mandibular tooth"
855-
},
856-
"target":
857-
{
858-
// SpecificResource with PointSelector
859-
}
860-
},
861-
{
862-
"id": "https://example.org/iiif/3d/commenting-anno-for-right-pterygoid-hamulus",
863-
"type": "Annotation",
864-
"motivation": ["commenting"],
865-
"body":
866-
{
867-
"type": "TextualBody",
868-
"value": "Right pterygoid hamulus"
869-
},
870-
"target":
871-
{
872-
// SpecificResource with PointSelector
873-
}
874-
},
875-
{
876-
"id": "https://example.org/iiif/3d/anno9",
877-
"type": "Annotation",
878-
"motivation": ["activating"],
879-
"target":
880-
{
881-
"id": "https://example.org/iiif/3d/commenting-anno-for-mandibular-tooth",
882-
"type": "Annotation"
883-
},
884-
"body":
885-
{
886-
"type": "SpecificResource",
887-
"source": {
888-
"id": "https://example.org/iiif/3d/anno-that-paints-desired-camera-to-view-tooth",
889-
"type": "Annotation"
890-
},
891-
"action": ["show", "enable", "select"]
892-
}
893-
}
894-
]
895-
}
896-
]
897-
}
898-
```
899766

900767
**Key Points**
901768
* The client will render a UI that presents the two commenting annotations in some form and allows the user to navigate between them. An active Camera is not provided. While there is a Camera in the Scene, it has [`behavior`][prezi-40-model-behavior] "hidden", and is inactive and not usable.

0 commit comments

Comments
 (0)