<p dir="auto">Hi,</p>
<p dir="auto">The things i've been playing the most with three.js are the shaderMaterial and the json exporter.</p>
<p dir="auto">My goal was to export the tangent space from 3ds max, and write a synced shader to unpack them.</p>
<p dir="auto">A crude example can be seen here:<br>
<a href="http://dusanbosnjak.com/test/webGL/new/poredjenjeNM/poredjenjeNormala_01.html" rel="nofollow">http://dusanbosnjak.com/test/webGL/new/poredjenjeNM/poredjenjeNormala_01.html</a><br>
The crude json format that im using currently looks like this:</p>
<p dir="auto"><a href="http://dusanbosnjak.com/test/webGL/new/poredjenjeNM/meshes/tocak_guma.js" rel="nofollow">http://dusanbosnjak.com/test/webGL/new/poredjenjeNM/meshes/tocak_guma.js</a></p>
<p dir="auto">I have some issues with these indecis, and UV channels along with normals/bitangent are scrambled, these can all probably be sorted during the export.<br>
I am a bit confused as to how this data gets mapped on the gpu.</p>
<p dir="auto">This particular mesh has 660 triangles, 360 vertices, 429 uv/norm/bitan. During the import I assign all of these values to each face, selecting them using the exported indecis from the json. I wanted to add a bitangent attribute, but there isn't a 'slot' so to speak.</p>
<p dir="auto">I could not figure out how to add this through the material attribute. Some examples i've seen iterate through this based on geometry.vertices but there are duplicates/splits - vertices that share two or more normals or uvs.</p>
<p dir="auto">The way i was able to hack this was by first extending face3 to hold another group of values for the bitang, and then copying the tangent buffer during the renderer setup. When the importer imports this mesh, it sets up a flag on it, and this additional attribute is created the same way it is for the tangents or normals. But now im stuck on using this particular build.</p>
<p dir="auto">I wonder if this makes any sense. What would be the best way of importing this additional attribute, and making sure that each and every value goes exactly where it needs to go.</p>
<h5 dir="auto">Description of the problem</h5>
<blockquote>
<p dir="auto">step 1:</p>
</blockquote>
<p dir="auto">change timeScale</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const clipDuration = clip.duration;                  // eg: 20s
this.animationAction = this.mixer.clipAction(clip, this.character);
// change timeScale
this.timeScale = clipDuration / duration;         // eg: 20s/10s = 2
this.animationAction.setEffectiveTimeScale(this.timeScale);"><pre class="notranslate"><code class="notranslate">const clipDuration = clip.duration;                  // eg: 20s
this.animationAction = this.mixer.clipAction(clip, this.character);
// change timeScale
this.timeScale = clipDuration / duration;         // eg: 20s/10s = 2
this.animationAction.setEffectiveTimeScale(this.timeScale);
</code></pre></div>
<blockquote>
<p dir="auto">step 2:</p>
</blockquote>
<p dir="auto">change time</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// duration is from 0 to 20;
this.animationAction.time = 10;"><pre class="notranslate"><code class="notranslate">// duration is from 0 to 20;
this.animationAction.time = 10;
</code></pre></div>
<h5 dir="auto">expected</h5>
<p dir="auto">Start playback from the correct time</p>
<h5 dir="auto">The actual situation</h5>
<p dir="auto">Will not end normally</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r117</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Chrome</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> macOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>