Giter VIP home page Giter VIP logo

frame3sharpsampleapp's Introduction

frame3SharpSampleApp

Sample Unity applications built using the frame3Sharp CAD-tool framework.

These samples are released under the MIT License, feel free to use them as a starting point.

Questions? Contact Ryan Schmidt @rms80 / gradientspace

Usage

CRITICAL: THIS REPO LINKS TO SUBMODULES. The majority of git clients do not automatically check out submodules!! If when you first check out this project, the Assets/geometry3Sharp folder is empty, you need to manually check out the submodules. The git command to grab all of them is:

git submodule update --init --recursive

Once you have done this, you should be able to open the Unity project without errors, and open and run the sample scenes.

VRSampleScene

This is a basic f3Sharp VR scene with a few sample objects and tools accessible via a basic cockpit (implemented in SetupBasicVRCockpit.cs). Although several unity scene files are in this subdirectory, likely the only fully functional one is AutoVRSampleScene.

unity screenshot

VR Controller Interactions

  • You can "single-click" the trigger on either controller to do actions like select objects, click on tool buttons, etc. When an object is selected it turns orange, as in the screenshot above, and a 3D manip gizmo appears. Use either trigger to click-drag on the elements of the 3D manip.

  • press and hold trigger+shoulder (rift) or trigger+grip (vive) on either hand while pointing at an object to "grab it" and them you can move it with the controller

  • press and hold both shoulder/grip buttons at the same time and then move your hands in various ways to do various 3D scene manipulations - see the View Controls section of this page page here, the behavior is the same

  • you can duplicate objects with 'd' key on keyboard, delete them with Delete, etc. Hotkeys are configured in SampleKeyHandler inside SetupBasicVRCockpit.cs

Tools and Cockpit

In f3Sharp, a Tool is a modal action attached to a hand/controller. When a Tool is actie on a hand, the cursor icon changes from an arrow to a "crayon" shape (green in screenshot below), and that tool button becomes yellow. Note that you can have multiple tools active simultaneously, ie one on each hand. (however the UI highlight may not update properly in this case...)

cockpit image

The cockpit sits "down" in the VR view. Currently it is a set of circular 3D buttons. On the right are three Tool Buttons:

  1. Draw Primitive Tool - when active on a hand, click-drag the trigger on that hand to begin drawing a primitive. Most primitives require 3 dimensions so after you set the base size/width, trigger-click again to set the height, and trigger-click a second time to complete the primitive. You can draw primitives on the ground plane or other surfaces. The selected primitive is set using the two buttons on the right side of the cockpit (currently cube and cylinder)

  2. Draw 3D Curve Tool - when active on a hand, click-drag the trigger to draw a 3D polyline at the tip of the controller

  3. Cancel Active Tool - when a tool is active on a hand, and you click on this button, the tool is deactivated

The Left buttons are used to select the active primitive for the Draw Primitive Tool. In addition, you can trigger-click-drag on these buttons to "drag" that primitive into the scene. You can also trigger-double-click on them to create one of these primitives at the origin.

Initial Objects

The initial objects in the AutoVRSampleScene are two bunny models with red and green (transparent) shaders. These are converted into frame3Sharp SceneObject instances in two ways - first by "wrapping" an arbitrary gameObject using UnitySceneUtil.WrapAnyGameObject(), and then by converting the MeshFilter mesh into a DMeshSO using UnitySceneUtil.WrapMeshGameObject. The latter works much better with f3Sharp but the former shows that it is possible to apply the manips/etc to arbitrary GameObjects.

When you draw primitives or curves, these become PrimitiveSO or PolyCurveSO SceneObjects.

Unity Scene Files

There are several scenes provided with different configurations. All of these scenes support mouse and gamepad input. Several support spatial input with the Oculus Touch or Vive Wands. For details on how to use those controllers, see the Simplex Touch Manual. Vive usage is similar. Not everything is included, but you can Grab Objects using the trigger+shoulder buttons (separate object with each hand!)

AutoVRSampleScene supports both Vive and Rift, and auto-configures for either using the gsUnityVR library. After the auto-configuration, the hand-tracked controllers can be used to interact with the scene.

OculusSampleScene and ViveSampleScene support each device separately, using the Camera Rigs provided by the OVR and SteamVR libraries (OVRCameraRig or [CameraRig])

VRSampleScene is just a generic VR environment, hand-tracked controllers are not supported.

The Frame3 framework is configured in the VRSampleSceneConfig.cs script, and the Cockpit (HUD UI, controller behaviors) is configured in SetupBasicVRCockpit.cs.

frame3sharpsampleapp's People

Contributors

rms80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

frame3sharpsampleapp's Issues

EditorXR support?

I just noticed this project from your mention on geometry3Sharp:
gradientspace/geometry3Sharp#83 (comment)

It's cool to see you go a similar approach in design with "handed tools" and an active tool in each hand. This is how EditorXR works utilizing a priority tool stack.

I know you're focused on gradientspace, but figured I'd mentioned EditorXR if you have any interest in having your tools run in the Unity Editor:
https://github.com/Unity-Technologies/EditorXR/

My hope is that it wouldn't be too hard to integrate EditorXR interfaces into your existing tools.

Separate from that, I think you might be interested in the Conditional Compilation Utility if you want to have defines automatically added to the Unity project upon detecting that a dependency exists. Optional assembly definition dependencies are coming to 2019.1, but this is a stop-gap for non-assembly projects:
https://github.com/Unity-Technologies/ConditionalCompilationUtility

I appreciate that you open-source the underlying tech that goes into your application. From the activity on geometry3Sharp it seems that you are serving quite a lot of people who were needing the functionality that your SDK has.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.