How to set camera position and save the Image seen by the camera as a JPG image?

#1

I am trying to develop an application using Visual Studio and C API that loads a SketchUp model and asks the user to enter location and orientation of the camera and saves the image seen by the camera as a jpg image. Is this possible using C API? What are the functions that I need to call to load the model, set the camera, and take the image and save it? Is there anything else I need to do?

Thank You,

0 Likes

#2

SUModelCreateFromFile
http://extensions.sketchup.com/developer_center/sketchup_c_api/sketchup/model_8h.html#a14af4587c84761d26dfdee908e73d9cd

SUModelSetCamera
http://extensions.sketchup.com/developer_center/sketchup_c_api/sketchup/model_8h.html#a0e9b076e8dff1daf1ada61d94bc6abf2

I’m not sure about this one - I’d encourage you to look through the documentation.

0 Likes

#3

Thank You thomthom. I searched the documentation, but I couldn’t find any way of storing the image. I had to switch to Ruby instead of C API. The function in Ruby is “view.write_image”.

0 Likes