Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by Matt Woods · May 11, 2011 at 07:56 PM · splinebezierpipetube

How best to make long pipes/cables in unity?

Hi,

I am working on an educational game that allows museum visitors to explore various undersea environments. One of these environments is the undersea portion of an oil rig.

http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc4/58056_10150339222165467_431744650466_16137589_7115424_n.jpg

I have or can create models representing the various undersea well heads and components, and these are easy to place into a unity terrain, but I need to connect them to long pipelines that eventually lead up to the surface. I am trying to figure out the best way to do this. These are big heavy pipes, so they don't really need any physics to them. Colliders would be nice, but not absolutely necessary.

From my searches it seems like the best way to do this, may be a line or tube renderer: http://www.unifycommunity.com/wiki/index.php?title=TubeRenderer

Unfortunately, both of these require very large arrays of vector3s which I can't find an easy way to create. I would like to be able to draw a smooth vector spline into 3d space, and render it either as a shaded, or preferably a dimensional tube, and be able to tweak positioning in unity.

The other way, I guess would be to make the pipes all in a 3d program and import them in as meshes. This might be better, but it would be hard to precisely connect them to the other models in unity, and have them lie along the bottom of the unity terrain.

Any suggestions?

Thanks,

-Matt

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Owen-Reynolds · May 12, 2011 at 01:06 AM

I'd go with the 3D modelling option. Just extrude a cylinder a whole lot, and give it bones with big, fat envelopes. Make the main bone be a short one on the bottom (the sea floor end,) where you want to bend them more, with longer ones near the top. No animation (or go ahead and make a few "swaying" clips.)

Twisting the bones (by hand, in SceneView/Inspector) will deform the object. I'm thinking if the bottom bone parents the rest, You can slap that right on your wellhead and tilt/animate the ones going up. They'll flap around at the top, but no one will be up there to see. If you want to hand-twist and animate, Additive animation mode might work.

You should be able to 3D model just one tube, and use different textures and scaling (in Unity) to reuse it for all the cables you need. If you need colliders, use the "compound" trick (one for each bone) and turn it into a prefab, to avoid the need to "collider up" each cable.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Joshua · May 12, 2011 at 02:15 AM 0
Share

I absolutely agree. $$anonymous$$ake one straight piece of pipe and one that bends either 90 or 45 degrees. Then make use of unity's snap to matrix (hold control when placing) function to easily place them.

avatar image Matt Woods · May 27, 2011 at 06:11 PM 0
Share

Sorry for the late reply. I got sidetracked on another project and then went on vacation, and forgot about this post. This sounds like the simplest solution, and one I didn't think of at all. I'm going to give it a try. Thanks much! -$$anonymous$$att

avatar image
2

Answer by Joshua · May 12, 2011 at 02:23 AM

If you're a somewhat experienced programmer and if you have to set up a lot of these pipes you could create an editor script that lets you do what you want - draw a spline in space and create it along the line. Actually, that's what is so fantastic in Unity, if you need to do something more then twice: write an editor script to do it for you.

To be honest it actually sounds like a fun challenge. If you'd like some help you can contact me through the forums. ^.^

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SpookyCat · May 12, 2011 at 06:41 AM 1
Share

That's what I did for my rope system, its not hard to do. http://forum.unity3d.com/threads/83330-Procedural-Rope-System

avatar image Joshua · May 12, 2011 at 11:32 AM 0
Share

Whow, that's a great looking end result. $$anonymous$$aking a non-moving pipe would be a lot easier though, I assume ;) would you be willing to share the script that actually creates the rope? I'd love to check if out and see if I can learn something of it - I have far to little experience with creating procedural meshes.

avatar image Owen-Reynolds · May 13, 2011 at 06:15 PM 0
Share

Josh, the OP has that link in his question.

avatar image Joshua · May 13, 2011 at 09:45 PM 0
Share

You're right >.< I just stumpeled upon it and thought it might help, so posted it without checking :p but if he uses that all he needs is an editscript that allow him to easily create and assign Vector3 positions..

avatar image Matt Woods · May 27, 2011 at 06:18 PM 0
Share

Hi Josh, Sorry for the late reply,
I'm still learning unity and Javascript, so this option sounded more complex. I'm going to try out Owen's boned cylinder solution but if for some reason that doesn't work out, I'll contact you.

PS. Cool rope simulation Chris! A bit more than I need at the moment, but it looks very cool.

Thanks all.

avatar image
0

Answer by lil_billy · May 12, 2011 at 01:48 AM

so heres a possible idea which might be somewhat labor intensive and or might not work so in pipelines theres always that connection joint now you should already have your basic pipe with texture that you can make as long as you want

but heres what i suggest you make the large part of that joint then you give it 2 children these will be flat cylinders slightly wider than your pipes but smaller than its parent and there length should be just long enough to hide any angles caused by this next step

next create a script create an empty variable to assign your pipe to in the scene then get the transform of that object in the update

transform.LookAt(object); 

-look at the scripting reference for a better description on how to do this

next put that script on the right cylinder then drag the pipe next to it into its variable slot then repeat for the left (DO not use colliders)

what you should be able to do at the end of this is lay pipes in at whatever angle you choose at the intersections of these pipes this joint should be placed its children should be assigned to the corresponding pipes next to them and their lengths should be just long enough to hide any angle caused by the connection

of course at the same time you could have just let the pipes intersect anyways since the player cant see the messy internal geometry, this just seems cleaner but colliders will destroy it

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

3D max spline animation to Unity 0 Answers

Extruding tube animation possible in Unity? 1 Answer

Generating a Flat Mesh from Spline/Bezier Curve? 1 Answer

leantween ltspline control points setup 0 Answers

Spline off center using iTween 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges