Hello,
I've run through the roller coaster demo setup, and was able to duplicate the demo in Stingray. As of Friday, playing the level (without Oculus), the viewpoint of the level test was that of the camera. This morning I tried the exact same file with the Oculus plugged in, and while Oculus can SEE the level, it is not seeing it form the same viewpoint.... it's like the camera is above and off to the side.
Is there something in the Oculus Lua that needs to be set to tell it to use the same camera?
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
Solved! Go to Solution.
Solved by MatthewDoyleArt. Go to Solution.
So close I can taste it. Your help has been invaluable, so thank you again.
What I am seeing now is: Without the HMD hooked up the animation plays fine and follows the camera as expected. With the HMD hooked up... animation doesn't play at all.
In my level flow, I have tried using input from both the mouse and the Oculus controller buttons, neither work with the HMD plugged in.
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
The last post I wrote works on my end. I have a Stingray camera that is animated with Story. I use that camera in the Lua code and when I have my Oculus DK2 plugged in, the animation works. Unfortunately, I cannot diagnose any Oculus controller issues, as I am using DK2 and I don't have the touch controls.
So, in order for me to diagnose what is wrong on your end going forward, I'll need to actually see your Stingray project. Can you provide it to me somehow? Dropbox, or any other file sharing will be fine.
Also, I need to know a few things:
What version of the Oculus runtime are you using?
What version of Stingray?
What OS?
@MatthewDoyleArt wrote:
The last post I wrote works on my end. I have a Stingray camera that is animated with Story. I use that camera in the Lua code and when I have my Oculus DK2 plugged in, the animation works. Unfortunately, I cannot diagnose any Oculus controller issues, as I am using DK2 and I don't have the touch controls.
So, in order for me to diagnose what is wrong on your end going forward, I'll need to actually see your Stingray project. Can you provide it to me somehow? Dropbox, or any other file sharing will be fine.
Also, I need to know a few things:
What version of the Oculus runtime are you using?
Oculus App Version 1.13.0.362051
What version of Stingray?
1.7.1177.0
What OS?
Win 10-64
My camera and animation were brought in from 3ds Max, maybe this is where the problem lies.
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
That's possibly it. Might be something very simple with how the camera is being referenced in code. I am downloading your project now. I'll get back to you soon.
Ok. Figured it out. It was in fact a camera referencing issue. Since you imported an animated camera from Max, you needed to get a reference to the "Walkthrough_Cam001" camera node in the unit, rather than its parent "walkthrough_cam001".
You can copy the entire working project.lua file from here: https://hastebin.com/uvojazobef.lua
Here's what I did:
Step 1: Define 2 local variables:
local walkthrough_cam001 = nil local myCam = nil
Step 2: Change local function get_player_pose() to this:
local function get_player_start_pose() local pose = stingray.Camera.world_pose(myCam, 1) return pose end
Step 3: Add the following code to function Project.on_level_load_pre_flow()
NOTE: You may need to play with the values I specify in the set_local_rotation part to get the correct rotation. Here's an explanation of the values:
stingray.Vector3(0, 1, 0) = the X, Y, Z axis that you want to rotate around. So, 0, 1, 0 = rotated around the Y axis. 0, 0, 1 would by rotate around the Z axis, and 1, 0, 0 would be to rotate around the X axis.
The 3.14 value is the amount to rotate by in radians. 3.14 radians = 180 degrees.
-- Get a reference to Unit walkthrough_cam001 = stingray.World.unit_by_name(SimpleProject.world, "walkthrough_cam001") -- Get a refernce to the actual camera in the Unit myCam = stingray.Unit.camera(walkthrough_cam001, "Walkthrough_Cam001") -- set rotation offset of myCam (otherwise, it will be rotated 180 degrees upsidedown in the HMD). stingray.Camera.set_local_rotation(myCam, walkthrough_cam001, stingray.Quaternion(stingray.Vector3(0, 1, 0), 3.14))
Step 4: Add this code to the function Project.update(dt):
local player_start_pose = get_player_start_pose() OculusVRSystem.set_tracking_space_pose(vr_system, player_start_pose)
Genius.
Thank you for all of your help, this seems to be working now. I appreciate the explanations as well, and all of the time you spent on my code. I had very little time to learn hoe to do this, and with your help it looks like we'll have something working in time.
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
Great! Glad it works. If you have any future issues with it, let me know.
Matthew Doyle can you please make a project with roller coaster to use vr HTC VIVE version
Hoping there are some experts still in this forum.... because I ain't one of them.
The solution for this thread no longer works, as the project.lua has changed dramatically in Interactive 2020. The language has changed, and I'm unsure how to proceed. I can launch the level, but I cannot figure out how to tie the camera to the HMD in this new program. I am NOT a programmer, so I don't know the code or where to put it in the project. Is anyone willing to look over the solution posted, and offer some insights into how to do the same thing in the new project.lua file? Is there a way to do this in the flow instead?
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
Can't find what you're looking for? Ask the community or share your knowledge.