Angle between normal of adjacent faces using the dot product:
dot(n1,n2)=∣n1∣⋅∣n2∣⋅cos(θ)
dot(n1,n2)=∣n1∣⋅∣n2∣⋅cos(θ)
Dot Product and Angle - https://mathinsight.org/search/?q=dot+product
Vector Normalization - https://en.wikipedia.org/wiki/Unit_vector
OpenGL: Normals - https://learnopengl.com/Lighting/Basic-Lighting
Wikipedia: Normal - https://en.wikipedia.org/wiki/Normal_(geometry)
OpenGL : Smooth Shading - https://www.opengl.org/archives/resources/faq/technical/
Blender Manual: Auto Smooth - https://docs.blender.org/manual/en/latest/modeling/modifiers/normals/smooth_by_angle.html
glm::vec3 n1(1.0f, 0.0f, 0.0f); // Normal vector 1
glm::vec3 n2(0.0f, 1.0f, 0.0f); // Normal vector 2
float dotProduct = glm::dot(n1, n2); // Dot product
float magnitudeN1 = glm::length(n1); // Magnitudes
float magnitudeN2 = glm::length(n2);
float cosTheta = dotProduct / (magnitudeN1 * magnitudeN2);// Cosine of the angle
float angle = glm::degrees(std::acos(cosTheta));// Angle in degrees
Nathan Jones - Digital Artist Blog
Nath's digital art blog of tests, experiments, notes and practice sessions.
Monday, 9 December 2024
Added a Smooth Normals Slide Bar
Added Some MAYA Style Navigation Functionality
Added some "Maya Style" Navigation control:
# mousePressEvent = True
# mouseReleaseEvent = False
# Rotate camera
camera_rotation[0] += delta.y() * 0.2
camera_rotation[1] += delta.x() * 0.2
# Pan camera
camera_translation[0] += delta.x() * 0.01
camera_translation[1] -= delta.y() * 0.01
# Zoom camera
camera_translation[2] += delta.y() * 0.05
3D App Creation - A learning exercise
Learning exercise - making a 3d app of some sort. Not sure what sort. c++ and python combo.
So far I've learnt about:
PyOpenGL = http://pyopengl.sourceforge.net/documentation/
GLFW = https://www.glfw.org/docs/latest/build_guide.html
vcpkg = automate dependency setup for GLFW and other libraries
vcpkg and CMake = https://vcpkg.io/en/getting-started.html
CMake Script FindGLFW3.cmake = https://cmake.org/cmake/help/latest/command/find_package.html
Wavefront OBJ = Details https://en.wikipedia.org/wiki/Wavefront_.obj_file
Lighting & Materials- OpenGL = https://learnopengl.com/Lighting/Basic-Lighting
Transformations - OpenGL = https://learnopengl.com/Getting-started/Transformations
Triangle Normal Calculation in OpenGL = https://learnopengl.com/Lighting/Basic-Lighting
OBJ Preprocessing for Compatibility = https://github.com/pywavefront/PyWavefront
Hardest part to solve - Exploding Vertices after obj import
Face Def / Quad Handling -
- OBJ files contain non-standard face definitions + use quads .
- Needed to convert quads to triangles = face definitions standardized.
- Had to remove unnecessary lines \ smoothing groups - simplify parsing.
Vertex Normalization -
- Needed to sort incorrect scaling or positioning due to varying coordinate extents = calculate (normalize) the center and maximum extent of the model
- needed to reposition and scaling vertices to fit within a view.
Missing Vertices -
- needed to use checks to skip invalid data = avoid crashing
Incomplete Triangles -
- The `pywavefront` library was, on my first attempt, returning only partial vertex data.
- Had to force triangles to adhered to a set length - for example the common graphics issue - avoiding malformed geometry.
Wednesday, 5 June 2024
learning exercise – animating explosions / projectiles with code and physics
Sunday, 2 June 2024
Monday, 11 September 2023
Blender Auto rig Testing - Arm and Hand
Blender Auto rig Testing- Still figuring some things out before I move on to the Auto Clavicle, Spine, Hips and Feet. I managed to reduce the code down to just a dictionary that sets all info for each key bone - drivers, constraints, bone rotation order, parent hierarchy, alignment to template etc) - so I have a method to refine now.
Sunday, 27 August 2023
Blender Arm/Leg Auto Setup Rig Module - WIP (Python Tool)
Messing with my blender auto rig (Python) tool. Making things work like they do in Maya slowly - Arm/Leg + Stretchy pull off controls + Auto in between Archs + FK/IK Switch + auto bone control curves.
Rotation distribution down the chain:
Friday, 10 February 2023
Blender Auto-Rig Add-on
A test for a Blender Add-on I've been working on in what spare time I have. I've written most of the functions and classes I need to build any rig or animation tool. The fun part is being creative with them. Early days.
Saturday, 3 October 2020
Character controls in unity
I'm currently learning how to set up character controls in unity by writing little scripts and reading a few c# for unity books. No third person cam yet.... Just messing around at the moment but this is a lot of fun.
Wednesday, 30 September 2020
Saturday, 15 August 2020
Sunday, 26 July 2020
Python Learning in Blender- Sine expression to Drive Bone Rotation
- Scripted various controls with arguments for names/limits/shape etc
- Scripted a bone chain definition with arguments for names/numberOfBones/transformPlacement/axis/O.O.R etc
- Created a script to iterated through the bones and deliver a sine expression using the controllers Y transform as input variables for the bones XYZ rotations - sin(frame*"freq+...etc")
- Sine Expression implementation: https://en.wikipedia.org/wiki/Sine_wave
- Bone iteration for expression delivery: https://blenderartists.org/t/iterate-through-bones-of-armature/667942
- Driver delivery: https://blender.stackexchange.com/questions/13747/pose-bone-drivers-through-
Wednesday, 2 May 2018
Blender Add-on no:1 - Texture Set Manager
...as well as in Maya and Max.
I'm finding it useful for quickly flicking through textures in dense scenes and for keeping all texture sets named and organized.
Here is a flat shaded viewport screen grab of my text scene:
I can switch between image types( jpg,tif,png ), sizes( SM,MD,LG ) and image sets( type of
wood, skin, metal... etc ).
The process of making add-ons in blender is a relatively fast and simple one:
Tuesday, 1 May 2018
Modeling from perspective drawings in Blender and Maya
Friday, 9 February 2018
Metallic Carpenter Bee (Xylocopa (Lestis)) - 2nd V-Ray Render
Render in - V-Ray
Texturing in - ZBrush
A previous render and a modeling time-lapse can be found HERE
Wednesday, 24 January 2018
Redback Spider (W.I.P)
Test render of just the spider:
Wednesday, 3 January 2018
Art Station gallery
Sunday, 31 December 2017
Two random concept drawings - Science Fiction
Tuesday, 28 November 2017
Basic perspective principles/notes - Quick/unfinished Drawings
My aim isn't to have anything polished or finished atm. I simply want to revise some basic principles.
Reference links for One Point Perspective:
Reference links for Two Point Perspective
Perspective Drawing in Photoshop
01. Setup
- Red Square= station point (with 90 degree lines extending to Vanishing Points)
- Green Inner Circle= Cone of Vision (60 degrees - minimal distortion)
- Light Blue Horizontal Line = Horizon
Here are some links and notes on ellipses that, in turn, can be used to create squares in perspective.
Reference sourced from: The Bad Ellipse: Circles in Perspective - The Minor Axis is the Key
Close to, or outside of, the cone of vision distortion will cause alighnment issues. My cylinder extends out past the COV.
Here is a link to a video by Irshad Karim describing how to do this.
Adding more ellipses to create a cylinder and using this "scaffolding" to rough in some shapes.
Adding some background Mech/Tech Stuff. I think it will be a walkway. I also defined the frame region. Normally its best to frame a region far inside the cone of vision however, as I want to experiment a bit, I've extended the scene beyond this region.
Exploring some shapes with ellipses. Note the direction of the minor axis:
Exploring more shapes:
Forms extracted from construction lines:
Adding a science fiction tunnel outside the cone of vision. (note: I added some wires and tubes to the cylinder but didn't like them)
Simple cross lines to obtain an even spacing. Note the direction the the minor axis in red.
Some mechanical objects:
I"ll take some progress photos and see what works and what doesn't. I'm interested to see if creating constructions, lines as rough guides, is helpful.
First a helicopter created by sketching a box and adding construction lines - like chipping away at a block of marble:
Next airplane sketched from a bunch of sketched boxes with the aim of finding placement points for curves.
Some very quickly sketched ideas drawn from an initial box.
Page 1:
Some progress shots complied as animated gifs:
Another way to perspective freehand sketch is from the inside out. Scott peterson is a master at this technique. Check his site out here: Scott Peterson on YouTube
This feels like modeling in 3D and starts from a basis of what, in 3D, would be called image planes for side and top views. The side view is therefore drawn along the center line and the top view on the ground plane. Positional co-ordinates are then plotted and mirrored to the other side via the ground projection. From these positions forms are built.
My first attempt is a tadpole. Note image planes on the center line, running through the center of the tadpole, and on the ground plane.
I'd like to choose one and redraw it into the Sci-Fi scene I started with as an experiment.
Base shape from circles:
Unfinished Line drawing:
Here is a very old and unfinished life sketch I did - with a warped perspective. This effect can be created by keeping in mind a 5 point perspective system like the one described here: How to draw in 5-Point Perspective
Here are some old perspective drawings I created around a decade ago together with the perspective lines used to create them. They were commissioned by Republic Films.