Decide how rotation socket type should be stored #92766

Closed
opened 2021-11-03 00:03:09 +01:00 by Hans Goudey · 15 comments
Member

A rotation socket type could be exposed to the used with an Euler rotation when exposed to nodes whether or not they are actually stored as Euler rotations. That begs the question, how should rotation attributes / intermediate results be stored?

  • Quaternions
    • Benefits: More foolproof rotations, ...
    • Downsides: More storage space, ...
  • Euler:
    • Benefits: Aligns to what users are used to better
    • Downsides: Gimbal lock, etc.
A rotation socket type could be exposed to the used with an Euler rotation when exposed to nodes whether or not they are actually stored as Euler rotations. That begs the question, how should rotation attributes / intermediate results be stored? - Quaternions - Benefits: More foolproof rotations, ... - Downsides: More storage space, ... - Euler: - Benefits: Aligns to what users are used to better - Downsides: Gimbal lock, etc.
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly

Added subscriber: @GeorgiaPacific

Added subscriber: @GeorgiaPacific

Added subscriber: @Jarrett-Johnson

Added subscriber: @Jarrett-Johnson

I figured that the user would still be interfacing with euler but the internal representation of the rotations would be quaternion (impl detail hidden from user).

I figured that the user would still be interfacing with euler but the internal representation of the rotations would be quaternion (impl detail hidden from user).
Member

Added subscriber: @zanqdo

Added subscriber: @zanqdo

Added subscriber: @JacobMerrill-1

Added subscriber: @JacobMerrill-1

I would also allow matrix input into graphs from object info node,
edit nodes - object info - output - matrix

image.png

new node - from local to world space
input1 - pointer to bpy object
input2 - Vector3
output = object.matrix_world @ input2

image.png

new node world space to local space
input1 - pointer to bpy object
input2 - Vector3
output = object.matrix_world.inverted() @ input2

new node - transform - rotate - scale - offset - matrix - wraps mathtutils matrix class

this is the meat and potatoes of procedural generation

to get a objects X axis, we can use ob.matrix_world.col- [x] #x axis

'Decompose matrix to rot, scale, and pos, and X axis, Y and Z vectors'

we can rotate a matrix , then align to it, it's VERY handy.
@Ton

I would also allow matrix input into graphs from object info node, edit nodes - object info - output - matrix ![image.png](https://archive.blender.org/developer/F11722816/image.png) new node - **from local to world space** input1 - pointer to bpy object input2 - Vector3 output = object.matrix_world @ input2 ![image.png](https://archive.blender.org/developer/F11722907/image.png) new node **world space to local space** input1 - pointer to bpy object input2 - Vector3 output = object.matrix_world.inverted() @ input2 new node - transform - rotate - scale - offset - matrix - wraps mathtutils matrix class this is the meat and potatoes of procedural generation to get a objects X axis, we can use ob.matrix_world.col- [x] #x axis 'Decompose matrix to rot, scale, and pos, and X axis, Y and Z vectors' we can rotate a matrix , then align to it, it's VERY handy. @Ton

Added subscriber: @Ton

Added subscriber: @Ton
Author
Member

Removed subscriber: @Ton

Removed subscriber: @Ton
Author
Member

Currently we've settled on quaternions as the internal way to store rotations, unless some other reasoning we haven't though of comes up.
They're relatively small compared to 3x3 rotation matrices, and don't suffer from gimbal like Euler rotations.

Currently we've settled on quaternions as the internal way to store rotations, unless some other reasoning we haven't though of comes up. They're relatively small compared to 3x3 rotation matrices, and don't suffer from gimbal like Euler rotations.
Author
Member

@JacobMerrill-1 Working on storing rotations doesn't mean we can't add support for transform matrices later. In fact, even if matrices were the main way of passing around rotations, we would still want to store rotations as a way to build transform matrices from more user friendly components.

The discussion about world space transforms, etc. is unrelated. Geometry nodes works in the object's local space by design.

@JacobMerrill-1 Working on storing rotations doesn't mean we can't add support for transform matrices later. In fact, even if matrices were the main way of passing around rotations, we would still want to store rotations as a way to build transform matrices from more user friendly components. The discussion about world space transforms, etc. is unrelated. Geometry nodes works in the object's local space by design.

we can convert points relative to a object and then pass them into a texture for instance,
(similar to texture cord node in eevee shaders / cycles)*

we can apply forces in local space, acceleration etc using matrices

we can create our own parent like relationships using

local = object1.worldTransform.inverted() @ object2.location
rot_diff = object1.rotation_matrx.inverted @ object2.orientation_matrix

1 time, then each frame after

object.location = someOtherObject.matrix_world @ local
object.rotation = someOtherObject.rotation_matrix @ rot_diff

it's very powerful math that can do all sorts of stuff, that you intend and otherwise.

currently it's not easy to access a objects Axis Vector either*
angle = someObject.rotation_matrix.col- [x] #objects X axis
angle = someObject.rotation_matrix.col- [x] #objects Y axis
angle = someObject.rotation_matrix.col- [x] #objects Z axis

we can convert points relative to a object and then pass them into a texture for instance, (similar to texture cord node in eevee shaders / cycles)* we can apply forces in local space, acceleration etc using matrices we can create our own parent like relationships using local = object1.worldTransform.inverted() @ object2.location rot_diff = object1.rotation_matrx.inverted @ object2.orientation_matrix 1 time, then each frame after object.location = someOtherObject.matrix_world @ local object.rotation = someOtherObject.rotation_matrix @ rot_diff it's very powerful math that can do all sorts of stuff, that you intend and otherwise. currently it's not easy to access a objects Axis Vector either* angle = someObject.rotation_matrix.col- [x] #objects X axis angle = someObject.rotation_matrix.col- [x] #objects Y axis angle = someObject.rotation_matrix.col- [x] #objects Z axis

Added subscriber: @Aeraglyx

Added subscriber: @Aeraglyx
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2021-12-29 14:56:05 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#92766
No description provided.