Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

loadModel() options break without fileType and ignore flipU/flipV

オープン 初心者向け
#9,302 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript

調査の方向性

loadModel(path, options) のオプション解析は src/webgl/loading.js の573〜581行目付近にあります。issueによると、flipU と flipV が読まれる前に fileType が再代入されるため、options オブジェクトが .toLowerCase() に到達する可能性があります。まずそのブロックを読み、次に loadModel('model.obj', { flipU: true }) と fileType を含む形の両方で再現してください。両方の呼び出し形式がエラーなく読み込まれ、反転オプションが読み込まれたモデルに適用されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Area:WebGL p5.js 2.0+
Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)
p5.js version

2.3.2 / current main

Web browser and version

Chromium 151

Operating system

Fedora Linux

Steps to reproduce this

The documented loadModel(path, options) overload breaks depending on whether fileType is included.

async function setup() {
  createCanvas(100, 100, WEBGL);

  // Throws: fileType.toLowerCase is not a function
  await loadModel('model.obj', { flipU: true });

  // Loads, but flipU is ignored
  await loadModel('model.obj', {
    fileType: '.obj',
    flipU: true
  });
}

Options like { normalize: true } or {} also throw when fileType is omitted. With fileType present, flipU / flipV are ignored, although calling model.flipU() / model.flipV() afterwards works.

Expected: loadModel(path, options) should work without requiring fileType, and the flip options should be applied.

I traced it to the options parsing here:

https://github.com/processing/p5.js/blob/24a68d5c19eb70931c9a08c41b43a658978835f3/src/webgl/loading.js#L573-L581

fileType is reassigned before flipU / flipV are read, so without fileType the options object eventually reaches .toLowerCase(), while with it the flags are read from a string.

主要言語
JavaScript
スター
24.1k
フォーク
3.9k
平均マージ
2日 22時間
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

processing/p5.js のほかの issue

processing/p5.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。