Companion videos on YouTube:
Hi everyone,
It’s probably best to work through this written tutorial step by step but as a visual aid, I’ve created a series of companion videos and posted them on YouTube.You can find the playlist here: https://www.youtube.com/watch?v=-q965SGPzzU&list=PL0JBlaeAgD15fFWHx4d6bFTVR6Je9zCpl
Introduction (Video 1):
Prerequisites (Video 1):
Prepare “SteamVR Unity Toolkit” project files (Video 1):
Surface normal direction (Video 2):
Create collision mesh geometry (Video 2):
Export DGN geometry as FBX files (Video 2):
Create a Unity Project (Video 3):
Add Prefabs and Scripts to the Unity project (Video 3):
Import FBX files and set default attributes (Video 4):
Add FBX files to the Unity project (Video 4):
Setup Valve’s “The Lab Renderer” (Video 5):
Setup Directional Light (Video 5):
View your scene in VR with the HTC Vive headset (Video 6):
Known workflow difficulties (Video 6):
And that's all there is to it :-)
Andrew.
Hi Andrew, Thanks for the fabulous tutorial! It's very clearly explained and easy to follow. I am currently working on a MicroStation to Unity to VR workflow and need some of your help if possible. I'm using MicroStation CONNECT Edition. I followed your tutorial very closely to export each DGN to FBX in small chunks. Then I imported all FBXs in Unity 5.4.2f2 Personal Edition. However, when I drag the models in the scene, they are all centered at a given non-zero origin, all piled up on each other. In MicroStation, these DGNs are all part of a big structure so that each DGN fits like a piece of the puzzle. I would expect them to retain their original position when imported in Unity. Any hints on what's happening and how to fix this?
Unknown said:Any hints on what's happening and how to fix this?
Hi KR, sorry it took me a while to respond but I didn’t realise you had posted a question. All that aside, it’s great seeing people embrace VR :-)
I’m still using MicroStation SS3 but I do remember some people reporting an issue with the FBX exporter in MicroStation Connect. I don’t know if the problem has been fixed in the various updates but the more I think about it, the more I think that this might be your problem.
Is there any chance that you could try exporting the FBX files using MicroStation SS3 just to confirm that the problem is not with MicroStation Connect?
It’s hard to troubleshoot because it looks like you’re doing everything correctly but lets just run through a few things…
* When you dragged the FBX files into the “Main” scene in your Unity project, did you click on each FBX file and check in the “Inspector” window that the Position, Rotation, & Scale transforms were set to (0,0,0), (0,0,0), & (1,1,1) respectively?
* Is your MicroStation geometry drawn near the design cube origin? If not, I think it’s worth creating a special set of Reference files for the Unity export process. These files should reference the relevant geometry but move it all to the same relative spot near the design cube origin (0,0,0).
If none of that works and if it’s feasible to upload your MicroStation project somewhere, I could take a look at it and see if I can make it work with my setup.
Cheers,
P.S. In my spare time I’ve been working on a model of the “Eagle Transporter” space ship from the “Space 1999” television series. If anyone has an HTC Vive and is interested in seeing the model in VR, send me a Private Message with your Email address and I’ll send you a download link. It’s still a work in progress but I’m so chuffed with the outcome :-)
Unknown said:What were the render & material settings?
Hi Duncan,
Do you mean the settings for the image or the Unity Project? Anyone who knows me, knows that I'm a Maxwell Render fanboy so of course the image was done with Maxwell and a very simple HDR light. The materials are a work in progress but are simple Maxwell two layer BSDF materials.
As far as the Unity settings go, well they're pretty standard as well but I do struggle with the baked lighting. The next version of Unity (v5.6) is supposed to come with OctaneRender built in for free so I'm quite excited to see how that handles baked global illumination :-)
Unknown said:When you say "drag the FBX into the Main scene", do you mean dragging in the hierarchy or the actual 3D scene viewer?
I don't think it matters which window you drag your FBX files into, Just make sure the position, rotation, and scale transforms are set to (0,0,0), (0,0,0), and (1,1,1). And remember that setting these transforms to zero only means that the FBX files will be consistently aligned. If the geometry inside those FBX files is thousands of meters away from the origin then that'll be what you get in Unity.
Unknown said:my MicroStation geometry is drawn very far from the design cube origin. In fact, the X, Y, Z values in MicroStation are in the hundreds and thousands of units away from the origin. But I'm really new to MicroStation and don't know how to create those reference files and how to move them to the design cube origin.
I'm not really sure how tolerant Unity is to geometry being thousands of meters away from the origin but that would be a red flag if this was my project. Reference files are a key feature of any MicroStation project. The concepts a quite straight forward and you'd be doing yourself a big favour if you got your head around them. But basically you should:* Create a new empty 3D DGN file.* Open the References dialog box and attach whatever external DGN files that you need to. Use Live Nesting if you need to but I'd avoid that as much as possible.* There are many ways to find out how far away your geometry is from the origin but I'd start off by placing the start point of a line somewhere in the middle of your geometry and then the end point by keying in "xy=0,0,0"* Do a "Fit View" in the Top & Front views so that you can see the extent of all of your geometry (including the newly placed line).* measure the line so you have an idea of how much you will need to move your Reference files in the X,Y,Z directions.* In the References dialog box you can highlight all of your Reference files and then in the bottom section of that dialog box you can key in the desired values for the "Offset X, Y, Z".* Delete the line you drew earlier and do a "Fit View"
Unknown said:In fact, I have several hundreds of DGN files that fit into one big structure. Most DGNs have a list of reference files attached to them, while some don't or simply are referenced by other files. This seems to indicate that reference files already exist in my project. Am I right to deduce that?
Your deduction sounds right but I think your best bet is reference all of this stuff into an empty DGN file and move those reference to the design cube origin as I've explained above.
Unknown said:That is why I went back to MicroStation after finding out that its FBXs work very well in VR. Should I use a different version of Unity? PRO maybe?
No need to use a different version of Unity. I'm pretty sure they are all the same in this regard.
I hope some of this helps but it's hard not knowing how your project is set up. Additionally, I have no experience with NavisWorks so I don't know what issues this brings along for the ride.