UIObject3D works by creating an instance of your prefab or model in your scene, aiming a camera at it, and rendering what that camera sees to a sprite which is then rendered by a Unity UI Image component.
The target object and its camera are in a separate layer to the rest of your scene, so they are not visible to your regular cameras, nor is the rest of your scene visible to the target camera.
UIObject3D only renders an updated image when its properties change (rather than every frame), so it only has a minimal impact on the performance of your game or application. Additionally, the target object and camera will be cleaned up by UIObject3D whenever it is disabled or destroyed.
</HowUiobject3dWorks>
</AddingANewUiobject3dToYourUI>
To specify which model or prefab to render, simply drag the object from the project window into the 'Object Prefab' field.
</SettingTheTargetObject>
This specifies the targets desired rotation using euclidean angles (x,y,z).
Please note that this rotation is applied after the base prefab or model's rotation, so if your prefab is already set to your desired rotation, then you won't need to manipulate this property.
These properties allow you to move the target object left/right (X) and up/down (Y) relative to the center of the image and accepts values between -1 and 1, where 0 is in the center.
By default, UIObject3D will attempt to calculate the best value to scale your model or prefab by in order for it to fit properly within the camera frustum. However, for some more complex prefabs (such as those comprised of multiple models), you may need to override this value. This property allows you to do so.
This field will show the scale value that UIObject3D has calculated for your prefab in order for it to fit properly within the camera frustum.
If 'Override Target Scale' is enabled, then you can manually specify a value here.
</ManipulatingTheTargetObject>
This adjusts the field-of-view of the target camera. (default value: 35)
This adjusts how far away the camera is from the target object. The lower the value, the further away the camera will be and the smaller the object will appear to be (default value: -3.5)
This specifies an optional background color for the image. The default value is transparent.
</ManipulatingTheTargetCamera>
If this property is enabled, then a Unity Light object will be attached to the camera, lighting up the target object with the chosen color and intensity.
Specifies the color of the light object (if enabled).
Specifies the intensity of the light object (if enabled).
Regard directional lights:
By default, UIObject3D targets will be lit by directional lighting within your scene (if any directional lights are present).
If you'd like to prevent this, then you will need to adjust the directional light's Culling Mask and remove the UIObject3D layer.
</ManipulatingLightingForTheTargetObject>
By default, UIObject3D will only render an updated image if any of its properties change (whether that change is made via the inspector, or in code), which helps keep its performance impact to a minimum. However, in some cases you may wish to take advantage of some additional performance-enhancing features UIObject3D provides, such as when you are updating large numbers of UIObject3D objects each frame.
If this property is enabled, then UIObject3D will never exceed the frame rate limit specified by the 'Frame Rate Limit'. If this property is disabled, then it will render at (up to) the global frame rate.
Specifies the maximum number of frames per second at which to render the target object.
If this property is enabled, then the UIObject3D image will be rendered (updated) constantly (using the frame rate limit, if enabled), even if none of the UIObject3D properties change.
This may be useful if, for example, your prefab has animations which you wish to be visible. However, enabling this option will cause UIObject3D to render a lot more frequently than it normally does, which may have a performance impact.
</Performance>
As UIObject3D produces a regular sprite which is rendered by a Unity UI Image component (specifically, it uses 'UIObject3DImage' which extends 'Image'), you can manipulate the result using any effects which would normally work on an 'Image' component, for example:
</AdditionalEffects>
In order to make rotating objects (a common scenario) easier, UIObject3D provides the 'RotateUIObject3D' component which can be added to the same GameObject as the UIObject3D.
This property specifies when the object should be rotated. The options are:
Specifies that the object should be rotated in the specified Euclidean plane.
Specifies how fast the object should be rotated in the specified plane. Negative values are acceptable.
How long it should take for the object to return to its original position when 'When Mouse Is Over Then Snap Back' rotation mode is used.
</TheRotateuiobject3dComponent>
The DragRotateUIObject3D component allows you to drag the target object and rotate it.
Allow rotation in the specified direction (X - Left/Right, Y - Up/Down)
If these properties are enabled, then the object will rotate in the opposite direction on the specified plane.
Specifies how responsive the object is to being dragged. A lower value will result in the object taking more effort to drag.
</TheDragrotateuiobject3dComponent>