# Camera Position to specific ShapeDiverDisplayGeometry

**URL:** <https://discourse.mcneel.com/t/camera-position-to-specific-shapediverdisplaygeometry/95140>\
**Category:** ShapeDiver\
**Created:** [January 21, 2020, 3:24pm UTC](https://discourse.mcneel.com/t/camera-position-to-specific-shapediverdisplaygeometry/95140 "2020-01-21T15:24:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josegomezrivera95](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/josegomezrivera95/32/190106_2.png) [@josegomezrivera95](https://discourse.mcneel.com/u/josegomezrivera95)\
**Post date:** [January 21, 2020, 3:24pm UTC](https://discourse.mcneel.com/t/camera-position-to-specific-shapediverdisplaygeometry/95140/1 "2020-01-21T15:24:58Z")

</div>

Hi everyone,

I want to represent an engraving of a personalized message in a furniture configurator using the ShapeDiverTextInput, to generate a 3D text that will be displayed on a cover, simulating the engraving of the message. I used that feature through the API and it works OK.

But I have this question: Is there be any method to be able to zoom with the camera to that specific point where the message is located? I understand that with api.scene.camera.updateAsync (position, target) I can specify my new camera [Moving Camera to a Certain Position so that it fully Shows a Specified Geometry](https://discourse.mcneel.com/t/moving-camera-to-a-certain-position-so-that-it-fully-shows-a-specified-geometry/92159/2): but my problem is that I don’t know in which specific position my personalized message will be, since it responds to different positions regarding where is located the parametric furniture. It would be great to be able to zoom the BoundingBox of a specific ShapeDiverDisplayGeometry, and not the entire result.

Thanks!

Regards,

---

<div class="post-metadata">

**Author:** ![edsahergom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/edsahergom/32/479537_2.png) [@edsahergom](https://discourse.mcneel.com/u/edsahergom)\
**Post date:** [January 22, 2020, 2:26pm UTC](https://discourse.mcneel.com/t/camera-position-to-specific-shapediverdisplaygeometry/95140/2 "2020-01-22T14:26:00Z")

</div>

Hi @josegomezrivera95, you can get the final position of your engraving from Grasshopper by using the [ShapeDiverDataOutput](https://support.shapediver.com/hc/en-us/articles/360015413151-Component-Data-Output) component. Just input the resulting point into the data output and then you will be able to access the data with the function [api.scene.getData()](https://support.shapediver.com/hc/en-us/articles/360010057640-Fetching-data-from-the-model).

Hope it helps.

---

<div class="post-metadata">

**Author:** ![josegomezrivera95](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/josegomezrivera95/32/190106_2.png) [@josegomezrivera95](https://discourse.mcneel.com/u/josegomezrivera95)\
**Post date:** [January 22, 2020, 2:43pm UTC](https://discourse.mcneel.com/t/camera-position-to-specific-shapediverdisplaygeometry/95140/3 "2020-01-22T14:43:17Z")

</div>

Thanks @edsahergom

It’s a great solution. I will try it.

Thank you!

---

<div class="post-metadata">

**Author:** ![DAUD](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/daud/32/155637_2.png) [@DAUD](https://discourse.mcneel.com/u/DAUD)\
**Post date:** [March 24, 2020, 1:56pm UTC](https://discourse.mcneel.com/t/camera-position-to-specific-shapediverdisplaygeometry/95140/4 "2020-03-24T13:56:00Z")

</div>

Hey @josegomezrivera95,

just one quick remark to be sure you are aware of this: When implementing your solution for zooming to the extents of a specified geometry (thanks again!), I realized that the camera does not already need to be positioned on a geometry to zoom to its extents.  
For example:

> api.scene.camera.updateAsync({  
> position:{x:0,y:0,z:1000}, //top view  
> target:{x:0,y:0,z:0}  
> },  
> {duration: 0 }  
> ).then(function () {  
> //zoom you camera in the object you want to see with a 0 duration  
> api.scene.camera.zoomAsync([scenePath], { duration: 0 })  
> });

This function will zoom to the extents of the geometry “scenePath”, even if it does not lie at x:0, y:0. That means you only need to know from which orientation you want to view at the engraving and not precisely where it is located. For example, you would use position:{x:0,y:0,z:1}, target:{x:0,y:0,z:0} for a top view, position:{x:1,y:1,z:1}, target:{x:0,y:0,z:0} for a perspective and so on…

David
