Skip to content

Instantly share code, notes, and snippets.

View rotoglup's full-sized avatar

Nicolas Lelong rotoglup

View GitHub Profile

Once more, I'm struggling to wrap my head around the threejs API, here are my notes.

IMPORTANT base on threejs r114 (march 2020)

API topics covered :

  • Scene and Object3D, hierarchy, transforms
  • Maths, linear algebra
  • DirectionalLight, as I'm currently trying to understand how to attach one of them to a Camera...

Based on my looking at ThreeJS r115dev source code, while trying to figure out how to customize the lighting by writing my own shader.

Materials

ThreeJS has the following Material classes :

  • MeshBasicMaterial, not affected by lights
  • MeshLambertMaterial: lighting is computed at each vertex, for diffuse lighting, and interpolated in gouraud like fashion
@rotoglup
rotoglup / 202005 - threejs gotchas.md
Last active May 18, 2020 15:18
A personal list of traps if fell into using threejs

applyMatrix on Geometry does not flip faces when needed

applyMatrix, on Geometry or BufferGeometry, does not flip faces indices when applying a matrix that flips normals (determinant < 0).

see mrdoob/three.js#17361

@rotoglup
rotoglup / 202005 - notes about c-c++ libraries.md
Last active November 15, 2020 10:24
Random notes while using random libraries

In an administrator PowerShell console

  • Get-NetConnectionProfile
  • Set-NetConnectionProfile -InterfaceAlias "Ethernet" -NetworkCategory Private

or

  • Set-NetConnectionProfile -Name "Ethernet" -NetworkCategory Private

Conan (on Windows)

  • conan search <name> -r conan-center

What I liked :

  • easy install through python's pip

What I don't like :

@rotoglup
rotoglup / MetalConstants.h
Last active October 1, 2020 09:25
Definition of some Metal constant values
//******************************************************************************
//
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@rotoglup
rotoglup / GIT usage.md
Last active November 24, 2020 14:37
Notes about my usage of GIT

My GIT habits :

  • On Windows, through GIT bash

  • No UI, except occasional gitk --all& to visually check branches and commits

  • Use git fetch then git merge --ff-only origin/master

    • I don't like git pull auto-merging feature that messes up the history
  • Use git add -p to :

  • make a quick review of changes before commit

@rotoglup
rotoglup / Code refactor, thoughts.md
Last active December 7, 2020 18:00
Code refactor, thoughts

Some thoughts about code structure, as I read code, and find some things some hard to follow than others.

Booleans are values

(m_ui.SomeCheckBox->checkState() == Qt::CheckState::Checked) ? true : false

Should probably just be