I wrote a small module library using stravant’s 3D Gui functions. Its a bit advanced in terms of handling 3D snapped objects, but the api is easy to use.
When you call require on the module, it returns a userdata with a few functions in it.
The main method of the module is [b]3DModule:Attach3D(Instance guiObj, Instance model) [/b] The module will create a clone of the model you want to snap to the GUI's location, and it will handle the CFrame & distance to make it look like its part of the GUI.
guiObj must be any kind of Gui object that contains a UDim2 Position property, such as a Frame, ImageLabel, etc.
model can be either a Model, or a BasePart (Part, Wedge, Truss, etc)
When the function is called, it will return a userdata (3dController) with two functions and one property.
3dController:SetActive(boolean active)
Toggles whether or not the 3D Object should be shown or not
3dController:SetCFrame(CoordinateFrame Offset)
Sets a CFrame offset from the location its trying to place the 3D Model.
3dController.Object3D
The model in use by the controller [read only]
There are a few additional functions found inside of it, but most of them are just used by Attach3D itself.
Module:GetScreenResolution()
Returns a Vector2 of the client’s resolution
ModuleAPI:PointToScreenSpace(Vector3 at)
Converts a Vector3 location into a Vector2 location on the client’s screen
ModuleAPI:ScreenSpaceToWorld(number x, number y,number depth)
Converts an X/Y coordinate on the client’s screen into a Vector3 using the depth to determine how small/far away or large/close it should be
ModuleAPI:GetDepthForWidth(number partWidth,int visibleSize)
Takes the width of a part (partWidth) and the absolute pixel width of a gui object (visibleSize) and converts it into a depth to be used with ScreenSpaceToWorld
Here's a picture I took of my module simply applying the effect to a 200x200 Frame (don't mind the guy in the background, I was debugging) [spoiler]
[/spoiler]
PLEASE NOTE: The API assumes there is nothing in front of the model being displayed (whether its a GUI, or anything in the workspace). You need to manually put a BillBoardGui behind your 3D Display as well as handle a camera system for showing it properly. Also note that this does not support character models too well.
Enjoy!