けん@学生

自分が独学で学んだことを発信する

three.jsでtexture、normalMap、roughnessMapを貼ってみた

webpackでexrファイルの読み込みは

file-loaderにexrと記述するだけ


{
  test: /\.(jpg|png|gif|exr|svg|gltf|glb)$/,
    use: [
            {
             loader: 'file-loader',
             options: {
             outputPath: 'assets/images/',
           },
       },
   ],
}

 

nomalmapを使う時はEXRLoaderを使う

this.exrloader = new EXRLoader();
 
const geometry = new THREE.SphereGeometry(30, 30, 30);

const texture = new THREE.TextureLoader().load(textures[i], (texture) => {
     texture.wrapS = THREE.RepeatWrapping;
     texture.wrapT = THREE.RepeatWrapping;
     texture.repeat.set(1, 1);
});
 
const nomal = this.exrloader.load(leathernormal, (texture) => {
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set(1, 1);
}
 
~

const material = new THREE.MeshStandardMaterial({
    map: texture,
    normalMap: normal,
    roughnessMap: rough,
});
 

gltfで出した時のエラー[THREE.Object3D.add: object not an instance of THREE.Object3D.]

THREE.Object3D.add: object not an instance of THREE.Object3D.

 

const loader = new GLTFLoader();
  loader.load(glbmodel, (gltf) => {
   scene.add(gltf);
});

上のコードでエラーが出たので、

調べてみたら

const loader = new GLTFLoader();
 
let example = new THREE.Object3D();
loader.load(glbmodel, (gltf) => {
  example = gltf.scene;
  const radian = (i / this.index) * Math.PI * 2;
    scene.add(example);
  });

 

この2行を追加するらしい〜

let example = new THREE.Object3D();

example = gltf.scene;

 

以上。

 

 

 

参考

stackoverflow.com

 

【Blender初心者】ノードラングラーをmacで動かす方法

Node Wranglerのマテリアル設定で、WinだとShift + Ctrl + T

が起動するがMacだとできない。

 

ということで、あまり情報がなかったので探してあったので載せます。

 

シェーダーエディターで

 

Shift + W

 

すると出てきた。

 

あと、横にありました。

https://i.stack.imgur.com/TzvPp.png

 

 

www.reddit.com

 

blender.stackexchange.com

【Blender初心者】ノードラングラーをmacで動かす方法

Node Wranglerのマテリアル設定で、WinだとShift + Ctrl + T

が起動するがMacだとできない。

 

ということで、あまり情報がなかったので探してあったので載せます。

 

シェーダーエディターで

 

Shift + W

 

すると出てきた。

 

 

www.reddit.com

Splineの使い方

spline.design

 

はじめまして、@jdfGRm2XW3IBhXU です。

Splineのチュートリアル紹介です。

 

チュートリアルとして自分が学んだYoutuberの動画を貼っておきます。 


EASILY Create Awesome 3D for the Web with Spline!

 

main 

画像画像

f:id:qgenhate:20210128223605j:plain

こちらはSplineの開始画面です。

 

Tab bar

f:id:qgenhate:20210129104929j:plain

 

・ユーザー名

・ファイル名(今見ているファイル)

・ファイル名

新しいファイル作成

・無料プランの人はアップグレード

 

 

Tool bar
画像

f:id:qgenhate:20210129104923j:plain

 

オブジェクト

・オブジェクトの一覧が表示されます

・プレート

・丸いプレート

・テキスト

・キューブ

・立体のボール

変形

・移動

・スケール

・回転

 

 

Side bar

f:id:qgenhate:20210129104926j:plain

左のサイドバーには、あなたのシーンのレイヤーまたはオブジェクトを示しています。

 

 

f:id:qgenhate:20210129104932j:plain

右のサイドバーには示してプロパティパネルを。各パネルでは、シーン全体または選択したオブジェクトからプロパティを変更できます。