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
0
Question by requimrar · Sep 26, 2012 at 03:48 PM · meshroomconcavetube

Is a 'Tube' mesh possibly in Unity3D?

HEYAYAYAY…. Anyway, I'm in the process of creating some assets for a game I'm working on. Now this isn't my first time with Unity3D (albeit my first serious try), but I'm asking:

Cheetah3D has this neat 'Tube' object. I haven't exported to Unity yet, but it appears to have normals on both sides (well, duh). My question is: can I have this as a sort of 'room' that can be explored on the inside, yet viewed from outside?

I read previously somewhere (I think on the KSP forums) that Unity doesn't support concave meshes due to the limitations of PhysX, but I still need to know for sure, before I spend a bunch of time on something that was never going to work.

Thanks.

Comment
Add comment · Show 3
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 Fattie · Sep 26, 2012 at 07:05 PM 0
Share

@equimrar are you there champ?

i happened to stumbled on this tremendously shorter answer than $$anonymous$$e to the same question!

http://answers.unity3d.com/questions/176487/$$anonymous$$aterialTexture-on-the-Inside-of-a-Sphere.html

hope it helps

avatar image requimrar · Sep 27, 2012 at 02:09 AM 0
Share

So since my mesh already has normals on both sides, I can simply apply the shader? The thing is that it's not a closed mesh, so I don't see how back face culling would take effect.

avatar image Fattie · Sep 27, 2012 at 06:48 AM 0
Share

"So since my mesh already has normals on both sides"

That is not possible. $$anonymous$$esh is single sided.

What you are seeing in Cheetah is two meshes back to back.

{OR it's using an internal Cheetah "trick" to paint the back of a mesh. (I am sorry I don't know which.) }

When Cheetah exports that it will export it as two meshes back to back.

All mesh is single sided. (Yes, you can use a "trick" of a special shader that will paint the back of mesh, BUT that is really irrelevant here. It sounds like you need a normal, everyday mesh for using with colliders and so on.)

Just as Bunn mentions "this tube object already has two seperate sides" - it's not a case of "one" mesh with normals on both sides. Hope this helps.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Bunny83 · Sep 26, 2012 at 03:57 PM

You mixed up a lot of different things ;)

  • Yes, you can have tube objects in Unity. From which side it can viewed depends only on the shader. Most shaders use backface culling, so they only render the "front" side. Each vertex only have one normal (at least in Unity). So you have only one normal for light calculations. It's possible to "transform" the normal in the shader, but usually you just model both sides as seperate triangles, one facing the front and one the back side.

  • Concave mesh-colliders are possible, but the only exception is that Unity (or PhysX) can't handle collisions between two concave (or non-convex to be more precise) colliders. Primitive colliders (Box, sphere, capsule) and convex meshcolliders can collide with non-convex coliders without any problems.

Comment
Add comment · Show 7 · 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 requimrar · Sep 27, 2012 at 02:14 AM 0
Share

Ah I see, confusion ensues! So basically, if I have this capsule collider representing a character, he can move about and collide on the inside of the tube without any problems?

Also: the 'tube' in question is not a cylinder with the top faces deleted, it is actually a tube: http://flic.kr/p/derZwZ

avatar image Bunny83 · Sep 27, 2012 at 03:46 AM 0
Share

Well, this tube object already has two seperate sides (as it should be ;) ), so each surface has it's own normal. So far for the rendering.

Yes, collisions usually should work just fine as long as no incredible large forces / velocities are used.

avatar image requimrar · Sep 27, 2012 at 04:05 AM 0
Share

Yay, thanks a bunch! Just to clarify, all I need to do is add a mesh collider to the whole thing, right?

avatar image Bunny83 · Sep 27, 2012 at 04:25 AM 0
Share

Yes ;) If the Renderer / $$anonymous$$eshFilter is on the same object, the $$anonymous$$eshCollider will automaticalls pick this $$anonymous$$esh as collision mesh. You can also use a different mesh if you want. Just assign the $$anonymous$$esh to the mesh variable of the $$anonymous$$eshCollider ;)

avatar image Fattie · Sep 27, 2012 at 06:51 AM 0
Share

Say @Bunn .. do you happen to know:

say you have a "back-to-back mesh". So it's one plane bent over, ie, a flat "U".

Simply do you know, does that work as a $$anonymous$$eshCollider?

Or does it confuse the mesh->to->meshcollider system in Unity, or, confuse PhysX ?? Cheers

(File under "too lazy to test" :-) )

Show more comments
avatar image
1

Answer by whydoidoit · Sep 26, 2012 at 03:53 PM

Yes you can. Normally such a shape has faces pointing in both directions (doubling up) but you can render the back face of a single face if you use the right shader too. MeshColliders are the thing with the convex property - they are a bit fragile - it depends what you want them for, but they back face cull which can lead to problems. Normally you would map primitive colliders onto your scene to make it more robust.

I would suggest that you make a scene out of bits that you construct in a modelling package rather than trying to render the whole thing there. Unity has a limit of 65,000 vertices per mesh in any case.

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

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I make a series of primitive planes and roll them into a tube? 1 Answer

moving hole 3 Answers

Null Reference Exception Assigning Vertices to Mesh 0 Answers

Md5mesh uvs and vertices bugging 0 Answers

Weapon system 0 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