Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 IIRawsomeII · Jul 06, 2017 at 01:17 AM · camerameshobjectclippingfill

Fill in mesh?

Hello

My Game requires the Camera to Clip into 3D Objects
The Problem is where the Insides of the Object are empty

I do not want to see the other side of the Object as a workaround.
So is there any way to fill the object, or at least create a plane where the Camera Clips the Mesh?

Thanks,

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by helgrind21 · Oct 27, 2020 at 07:41 PM

link textIf you haven't solved your problem yet.

Try using this: Triangulator

It worked for me with a non-convex shape.

Update

The link is off so I'm uploading the code I took from the unity doc.


triangulatorcs.zip (1.2 kB)
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 leonhogan1 · Feb 15 at 10:46 PM 0
Share

this link is broken D:

avatar image Eno-Khaon leonhogan1 · Feb 17 at 08:20 PM 1
Share

Updated the link to an archive.org variant.

avatar image
0

Answer by Cornelis-de-Jager · Jul 06, 2017 at 02:39 AM

Explanation:

So when Meshes are drawn, the mesh is constructed out of triangles which are only visible from one side. If you want to have the inside drawn aswell you essentially need to reverse all the triangles so that they are drawn from the other perspective then add the original perspective. This doubles the size of all your meshes. Below is a script I just wrote, not tested, that should draw the inside and outside on the start of the object lifespan. Just add the script to any in-game transform.

Solution:

     using UnityEngine;
     using Linq; // Add this <------------------------------------
     using System.Collections;
     
     public class FlipInsideOut: MonoBehaviour {

      void Start () {
         // Get the mesh
         Mesh mesh = GetComponent<MeshFilter>().mesh;
         // Get the both the inside and outside triangles
         int[] inside = mesh.triangles.Reverse().ToArray();
         int[] outside = mesh.triangles.ToArray();
 
        // Combine them into a new mesh array
         int[] combined = new int[inside.Length + outside.Length];
     
         Array.Copy(inside, combined, inside.Length);
         Array.Copy(outside, 0, combined, inside.Length, outside.Length);
 
        // Set the mesh array
         mesh.triangles = combined;
      }

Comment
Add comment · Show 12 · 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 IIRawsomeII · Jul 06, 2017 at 02:46 AM 0
Share

A lot Of Errors X[. T, Array2 and Array don't exist. Am I $$anonymous$$issing Something?

Raw-

avatar image Cornelis-de-Jager IIRawsomeII · Jul 06, 2017 at 03:05 AM 0
Share

Sorry the 'T' should be 'int'. I'll update

avatar image IIRawsomeII Cornelis-de-Jager · Jul 06, 2017 at 03:06 AM 0
Share

And the Array and Array2?

Show more comments

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

113 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Viewport Cliping, not camera. 0 Answers

Procedurally generated mesh disappears from certain camera angles 1 Answer

Render inside of mesh as black 2 Answers

Make object follow mouse, while actually moving camera, instead of object 2 Answers

Scale Vertices propotional to Camera Frustum 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