<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Mesh created at runtime, attached to a 3D marker, strange behavior]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=923&amp;type=atom" />
	<updated>2018-10-25T20:41:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=923</id>
		<entry>
			<title type="html"><![CDATA[Re: Mesh created at runtime, attached to a 3D marker, strange behavior]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4103#p4103" />
			<content type="html"><![CDATA[<p>So the problem was that i forgot to call &quot;Mesh.RecalculateBounds&quot; </p><p><a href="https://docs.unity3d.com/ScriptReference/Mesh.RecalculateBounds.html">https://docs.unity3d.com/ScriptReferenc … ounds.html</a></p><p>The documentation says &quot;Assigning triangles automatically recalculates the bounding volume.&quot; which is why i usually don&#039;t call this function when i&#039;m creating meshes at runtime. But in this case i&#039;m modifying vertices after having set the triangles.</p><p>I feel stupid but it works properly now <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Thibault]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=821</uri>
			</author>
			<updated>2018-10-25T20:41:21Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4103#p4103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Mesh created at runtime, attached to a 3D marker, strange behavior]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4098#p4098" />
			<content type="html"><![CDATA[<p>Hello.</p><p>I looked at your gif many times ... and I have no idea why this is happening.<br />If you send your project to us (support@infinity-code.com) I will be able to test it and tell you the exact cause of the problem.<br />Unfortunately, in this case, only using gif I can not do it.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-24T19:40:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4098#p4098</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Mesh created at runtime, attached to a 3D marker, strange behavior]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4095#p4095" />
			<content type="html"><![CDATA[<p>Hi</p><p>I made a prefab (named &quot;frustum&quot;) with an empty Gameobject containing a script, which create a mesh. This mesh is displaying properly in a regular empty scene.</p><p>I attached this prefab as a child to another prefab which i am using as a 3D marker in my scene with the map.</p><p>It doesn&#039;t display properly (see the GIF below). </p><p>I believed at first that i didn&#039;t code properly the mesh creation (particularly the normals) but i made a test :&nbsp; <br />If i manually add the frustum prefab in my scene at runtime, and make it a child of my 3D marker prefab manually, it display properly.</p><p>See the Gif below: <br />you will first see the &quot;frustum&quot; prefab not displaying properly.<br />Then i disable it and enable the &quot;frustum2&quot; prefab (that i manually added at runtime) <br />you will see that there is no problem with this one.</p><p><a href="https://media.giphy.com/media/5w2ejH86oVeMZd0ZvQ/giphy.gif">https://media.giphy.com/media/5w2ejH86o … /giphy.gif</a></p><p>You will find the script of the mesh creation attach to this message, though i don&#039;t think it is the problem anymore.</p><p>So one solution i have is problably to instantiate the frutum prefab separatly and assign it as a child of my drone prefab via script, but i would prefer to keep it as a part of the drone prefab if it is possible. Do you have any idea of what could occur this strange behavior ?</p>]]></content>
			<author>
				<name><![CDATA[Thibault]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=821</uri>
			</author>
			<updated>2018-10-24T19:10:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4095#p4095</id>
		</entry>
</feed>
