Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
TypeError: no se pudo ejecutar 'texImage2D' en 'WebGLRenderingContext': la resolución de sobrecarga falló

Estoy tratando de crear un personalizador 3d usando fabricjs como textura de lienzo para el modelo tres js. Cargo un archivo obj como este

 function loadObj() { canvasTexture.anisotropy = renderer.capabilities.getMaxAnisotropy(); textureMaterial = new THREE.MeshPhongMaterial({ map: canvasTexture }); texture.needsUpdate = true; var loader = new THREE.OBJLoader2(manager); loader.load('assets/men/cat1/model1.obj', function (data) { if (object != null) { scene.remove(object); } object = null; object = data.detail.loaderRootNode; materials = []; object.traverse(function (child) { if (child.isMesh) { child.material.map = textureMaterial; }; }); console.log(object.children[0].material) object.children[0].material = textureMaterial; render(); var scale = height / 5; object.scale.set(scale, scale, scale); object.position.set(0, -scale * 1.25, 0); object.rotation.set(0, Math.PI / 2, 0); object.receiveShadow = true; object.castShadow = true; scene.add(object); }); }

y aquí está mi tela js

 var canvas = new fabric.Canvas("canvas"); canvas.backgroundColor = "#FFBE9F"; var text = new fabric.IText('Three.js\n+\nFaBric.js', { fontSize: 100, textAlign: 'center', fontWeight: 'bold', left: 500, top: 500, originX: 'center', originY: 'center', selectable: true // make this object selectable }); fabric.loadSVGFromURL('assets/men/cat1/prod1/pattern.svg', function (objects, options) { var svgData = fabric.util.groupSVGElements(objects, { selectable: false,crossOrigin: 'anonymous' }); svgData.top = 420; svgData.left = 70; canvas.add(svgData); canvas.sendToBack(svgData); }); canvas.add(text); var texture = new THREE.Texture(document.getElementById("canvas")); fabric.Image.fromURL('assets/men/cat1/texture.png', function (myImg) { var img1 = myImg.set({ left: 0, top: 0, selectable: false,crossOrigin: 'anonymous' }); canvas.add(img1); canvas.sendToBack(img1); });

y mi modelo 3d es todo negro así

ingrese la descripción de la imagen aquí

¿alguien tiene alguna idea de cómo solucionar esto? quiero envolver mi lienzo fabricjs a mi modelo 3d

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de encontrar varias soluciones, descubrí que este problema tiene la misma solución que esta publicación sobre cómo cargar fabricjs como textura para obj usando threejs

el problema fue que utilicé el lienzo de THREE.Texture como argumento para TRES. Textura que solo admite imágenes, así que lo cambié a la etiqueta de lienzo en su lugar, lea la publicación anterior, espero que ayude a alguien.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!