You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user exporting a glb from 3dstreet for use in a third-party app like adobe aero, I want the textures from my 3dstreet scene to loop the same.
some of the layers are still exported differently than how they look in 3DStreets, particularly any lane which comes into AR with a center stripe even if one isn't present in 3DStreet. You can see the center stripe in the bike lane above from this Aero-based screenshot.
issue: many third-party apps don't respect gltf material transformations.
instead: use custom UV mappings for street segments instead of relying on three.js shader for texture repeat; ensure that exported geo with custom UV mappings look correct
Below is an example of a working function to repeat texture using uv coords instead of texture repeat shader
// Usage: <a-entity geometry="primitive: repeating-plane; width: 3; height: 50; segmentsHeight: 5; segmentsWidth: 1" material="src: #seamless-sidewalk"></a-entity>
AFRAME.registerGeometry('repeating-plane', {
schema: {
width: { default: 1, min: 0 },
height: { default: 1, min: 0 },
segmentsWidth: { default: 1, min: 1, max: 20, type: 'int' },
segmentsHeight: { default: 1, min: 1, max: 20, type: 'int' }
},
init: function (data) {
// Create base PlaneGeometry
const geometry = new THREE.PlaneGeometry(
data.width,
data.height,
data.segmentsWidth,
data.segmentsHeight
);
// Calculate number of vertices per row
const verticesPerRow = data.segmentsWidth + 1;
// Get UV attribute
const uvAttribute = geometry.attributes.uv;
const uvs = uvAttribute.array;
for (let i = 0; i < uvs.length; i += 2) {
// Calculate which row this vertex belongs to
const vertexRow = Math.floor(i / (2 * verticesPerRow));
// Keep the original x-coordinate (u)
// but modify the y-coordinate (v) based on row
const u = uvs[i];
const v = vertexRow % 2 === 0 ? 1 : 0;
// Update UV coordinates
uvs[i] = u; // x-coordinate (u) stays the same
uvs[i + 1] = v; // y-coordinate (v) alternates between 0 and 1
}
// Update UV attribute
uvAttribute.needsUpdate = true;
// Center the geometry at origin
geometry.center();
this.geometry = geometry;
}
});
The text was updated successfully, but these errors were encountered:
As a user exporting a glb from 3dstreet for use in a third-party app like adobe aero, I want the textures from my 3dstreet scene to loop the same.
issue: many third-party apps don't respect gltf material transformations.
instead: use custom UV mappings for street segments instead of relying on three.js shader for texture repeat; ensure that exported geo with custom UV mappings look correct
Below is an example of a working function to repeat texture using uv coords instead of texture repeat shader
The text was updated successfully, but these errors were encountered: