<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - materials and meshes]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=36&amp;type=atom"/>
	<updated>2011-02-25T13:02:59Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=36</id>
		<entry>
			<title type="html"><![CDATA[Re: materials and meshes]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=131#p131"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>yes, mesh is the same for each cube, materials too,<br />there is no entities-materials, but you can duplicate the mesh and apply each copy to a different cube.</p><p>- or by using a different .mesh file where you can change the material value using a text editor or Blender</p><p>- or by code, creating a MMeshRef manually :</p><p>MMeshRef * meshRef = MMeshRef::getNew(NULL, filename);<br />level-&gt;getMeshManager()-&gt;addRef(meshRef); // force without checking if the mesh already exist<br />meshRef-&gt;update();</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2011-02-25T13:02:59Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=131#p131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[materials and meshes]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=130#p130"/>
			<content type="html"><![CDATA[<p>Hi, <br />I&#039;m asking this question in the forum so other people can benefit.</p><p>I&#039;m trying to create a simple c++ app (starting the ManualUse example) to play a little with the physics and investigate on camera manipulators.<br />The app simply create a bunch of cubes and make them fall into a box<br />It has been very simple (with your help...) to setup the scene and make it running; but now I tried to assign a different color to each cube, setting the diffuse value</p><p>I tried with the following call:<br />box-&gt;getMesh()-&gt;getMaterial(0)-&gt;setDiffuse(0.6,0.5,0.4));</p><p>but this is affecting all the cubes, not only the one referenced by the *box entity pointer; the reason I believe is that one single mesh is used for all the cubes.<br />Is there a way to assign a different material to each entity, even if the entities refer to the same mesh?</p><p>thanks!!</p>]]></content>
			<author>
				<name><![CDATA[dbacchet]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=14</uri>
			</author>
			<updated>2011-02-25T11:21:53Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=130#p130</id>
		</entry>
</feed>
