Monday, 9 December 2024

Added a Smooth Normals Slide Bar

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

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



Velocity: v0=v×(1+random.uniform(−rv,rv))v0=v×(1+random.uniform(−rv,rv))
Mass: mass=m×(1+random.uniform(−rm,rm))mass=m×(1+random.uniform(−rm,rm))
Launch Angle: random.uniform(0,360)random_angle=random.uniform(0,360)
Mess with time (bit slow to process but things look bad if not slowed down for aesthetics):
Δt=0.1speed_factor×(1+random.uniform(−time_randomize_bias,time_randomize_bias))Δt=speed_factor0.1×(1+random.uniform(−time_randomize_bias,time_randomize_bias))
Bias Launch Direction:.
angle_variation=(1−direction_bias)×90angle_variation=(1−direction_bias)×90 and
random_angle=random.uniform(launch_angle−angle_variation,launch_angle+angle_variation)random_angle=random.uniform(launch_angle−angle_variation,launch_angle+angle_variation).
Air Resistance: (1−air_resistance×Δt (delta t) /randomized_mass)
Blender testing – any 3d program really - :

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

Sunday, 26 July 2020

Python Learning in Blender- Sine expression to Drive Bone Rotation


A quick python learning exercise in blender:
  1. Scripted various controls with arguments for names/limits/shape etc
  2. Scripted a bone chain definition with arguments for names/numberOfBones/transformPlacement/axis/O.O.R etc
  3. 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")
Links:
Now - the expression needs a little work (ie: clamp(#,#,#) etc), before I can expand upon it.

Wednesday, 2 May 2018

Blender Add-on no:1 - Texture Set Manager

I wanted a quick way to load, name and update texture sets based on selected objects so I coded this in Blender.

...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:
Render test:



 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

Friday, 9 February 2018

Wednesday, 24 January 2018

Redback Spider (W.I.P)

Modeling in   - Blender 
Hair added in - Maya
Rendered in   - V-Ray




Light Balance: 


Test render of  just the spider:





As a workflow test I decided to model a new Redback in Blender using Blenders Skin Modifer. Previously I modeled one in Maya.

I noted my first attempt at using Blenders Skin Modifier HERE. Once the base shape was created I retopologized the mesh using the blender add-on RetypoFlow.


Render test one. I created a web alpha in photoshop and projected them onto images planes in Maya. Here is a test render:
The web is, in all honesty, not very believable, the spiders joints are way to bright and the lighting isn't the best. I decided to do a test without a background or hair:

....could be better but, as always, it's a W.I.P.

Wednesday, 3 January 2018

Art Station gallery

I just created an Art Station gallery. I hope to grow it with plenty of random art this year.

Sunday, 31 December 2017

Tuesday, 28 November 2017

Basic perspective principles/notes - Quick/unfinished Drawings

This is a page of notes about perspective drawing. It's been a long time since I've drawn anything and so I wanted to complete a quick revision exercise. Hopefully it will get me back into the habit.

My aim isn't to have anything polished or finished atm. I simply want to revise some basic principles.

Here you will find some notes on very basic perspective principles/rules, some quick sketches and an unfinished line drawing along with various links. 



Reference links for One Point Perspective:
Reference links for Two Point Perspective
Perspective Drawing in Photoshop
01. Setup
Here is a reference image from chasrowe.com  showing a two point perspective system with a station point(90 degrees) and a cone of vision(60 degrees).httpwww.chasrowe.comhowToimagesperspectiveDrawing.jpg
My version:
  • 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
01_PERSPECTIVE_SCI-FI
I created some actions for the repetitive placement of the left and right vanishing points. This allows me to zoom in on a particular section and create the perspective line with a shift/click. I also made an erase action.
06_PERSPECTIVE_SCI-FI
06b_PERSPECTIVE_SCI-FI.jpg
02. Ellipses
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
03a_PERSPECTIVE_SCI-FI
The following images were sourced from Here (sfsu.edu - Scott Robertson & Neville Page):
e_1
httpuserwww.sfsu.edutrogu420referenceperspectivetutorialsellipses.html
With this in mind we can create a circle with the minor and major axes.
03b_PERSPECTIVE_SCI-FI
When we work digitally we can squish the circle into an ellipse, which is just a circle in perspective, with the minor axis pointing towards a vanishing point and the edges of the circle touching as shown in the above image, directly above/below the circle mid point or along a perspective line extending from the mid point.

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.

03_PERSPECTIVE_SCI-FI
The Cube by itself:
02_PERSPECTIVE_SCI-FI

Adding more ellipses to create a cylinder and using this "scaffolding" to rough in some shapes.
06e_PERSPECTIVE_SCI-FI

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.
backGroundBuildingBP01

Exploring some shapes with ellipses. Note the direction of the minor axis:
backGroundBuildingBP02b

Exploring more shapes:
backGroundBuildingBP03

Forms extracted from construction lines:
backGroundBuildingBP04b

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)

backGroundBuildingBP06

Simple cross lines to obtain an even spacing. Note the direction the the minor axis in red.
tunnel03 

tunnel05 

Creating evenly spaced lines
tunnel06 

tunnel07 

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:

HELI_01 

Next airplane sketched from a bunch of sketched boxes with the aim of finding placement points for curves.
HELI_02

Some very quickly sketched  ideas drawn from an initial box.
Page 1:

sheet001c_nwjones_drawings 
Page 2:

sheet002d_nwjones_drawings

Page 3:sheet003_nwjones_drawings

Some progress shots complied as animated gifs:
heliDoodle 

buggyDoodle2 

Note: I was a bit lazy with my ellipses and didn't stick to the initial structure at the front. Consequently things look a bit off.

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.
tadpole
Here is my second attempt - more made up stuff. The front curves of the plane are completely off but I like this process a lot. Practicing straight lines and ellipses should sort out some of the issues.
scfiPerspThumb001d 
Page 4:
planesSciFi01b

I'd like to choose one and redraw it into the Sci-Fi scene I started with as an experiment.
sketchBot06

Base shape from circles:
BotDev01
BotDev02
All shapes were multiplied back into the scene:
BotDev06
BotDev03

Unfinished Line drawing:
BotDev07

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.

StadiumPerspLines01 

Stadium01 

Image converted using ImgCvt 

Image converted using ImgCvt 

lastSupper01 

lastSupper_perspLines01