Questions tagged [mathematics]

Use of maths inside blender.

Filter by
Sorted by
Tagged with
2
votes
3answers
204 views

Proportionally editing an object using a given/exact angle

I can proportionally edit an object (see animation below) but if I want to alter an object to have an angle of 63.45 how can I go about calculating/doing this (I'm testing parameters/limits/tolerances ...
2
votes
2answers
6k views

What is the C# Mathf.Lerp equivalent in Python?

I have a basic menu script with a slider. The idea is that the slider will control the rotation of a bone. That bone will then rotate the object. I worked out the exact euler angles to rotate it by, ...
2
votes
2answers
308 views

Calculate sphere's rotation for rolling

Let's say that there is a sphere whose x,y,z dimensions are d. So, the circumference is d*pi. Now, the sphere is rolling on a ...
2
votes
2answers
4k views

How can I rotate multiple objects in their LOCAL axis?

Hello blender friends. I would like to rotate multiple objects by random, but in their LOCAl axis. NOT global. I already know the random transform function for objects, but it's working always for ...
2
votes
2answers
402 views

How to make variable transparency hole in a plane with a math function using nodes?

One way to make a transparent hole in a plane with graded transparency is to uv-map a solid, monochrome image with graded alpha (I assume). But can I do this with nodes? I've used the Error Function ...
2
votes
1answer
574 views

Why does “sin(frame)” where frame is “1” set a shape key to 0.841 and not 0.017?

I am trying to animate a shape key oscillating between -1 and 1 by driving it with the expression "sin(frame)". I would expect that to result in the shape key value being "0" at frame 0 and 180, a ...
2
votes
2answers
294 views

Match two planes with different origin locations (Blender Python Matrix Math)

We see two identical Plane objects: A(blue) and B(red) They are oriented arbitrarily in the 3D space. Notice that the origin of A is located in the center and the origin of B is located in the lower ...
2
votes
2answers
698 views

How to get all faces based on a certain angle of their normals?

I would like to create a list of faces/polygons based on the angle of each corresponding normal. I've tried something like board.data.polygons[0].normal > 0, but ...
2
votes
2answers
777 views

Nodes: Lighten/Darken “Crossfader”

What I seek I'm not sure if "crossfader" is the best way to describe it, but imagine black on one end, white on the other, and a grayscale image in the center. You can lighten or darken the image ...
2
votes
3answers
470 views

Ellipse Construction Advice

I'm working on a add-on for Blender, and part of this add-on requires me to calculate the position verts along the arc of an ellipse. At the moment, I'm using the { ...
2
votes
1answer
256 views

How can I align faces that share an edge in Python? (without moving the common edge)

I need to set a face's direction from a Python script using bpy modules. I tried the below code, but it does not work correctly. ...
2
votes
1answer
1k views

bisect plane normal (mesh and bmesh) how calc the 3th vector to mathutils.geometry?

UPDATE 1: how calc the 3th vector to mathutils.geometry.normal(vectors)?? After @Chebhou answer I tried my "bisector tool" again... with mesh and bmesh.. now the problem is the 3th vector to calc ...
2
votes
1answer
56 views

How to plot 1/x^x in Blender using Z function surface

I am looking to plot math functions in Blender using the Z function surface Add-On. It works great for functions such as: 1/x**2 But fails for functions like: ...
2
votes
1answer
100 views

looping through splines of a bezier circle, can only find 1 spline not 4

I'm trying to port differential line growth to blender animation nodes following this example https://vimeo.com/169438763 . I was suggested to work with splines in blender as it would be a lot simpler ...
2
votes
2answers
1k views

How to get angle of edge ? (python)

How can I get the angle of the edge , is there a method that return the angle of selected edge ?
2
votes
1answer
514 views

How to make a F-curve with a constant and linear part?

As part of a problem I need to obtain a curve in the graph editor, that has a constant part , followed by a linear one. for instance: for the interval [0,100] the curve is y=0 for the ...
2
votes
1answer
3k views

Python: Calculate angle between vertices

What should I do to determine the angle on XYZ between two vertices? I then have to rotate a mesh accordingly, but I guess that's a basic task to achieve. I'm new to bpy and I should have payed more ...
2
votes
1answer
49 views

inequalities using math node

Using math nodes I generated that pyramid like shape, but I want to impose inequalities. The equation for the following pic is 9-8|x|-y=0 but I want to impose inequalities to the equation where 0.75&...
2
votes
1answer
316 views

Smooth Realtime-Audio Reaction in Animation Nodes?

I am animating certain objects in a scene using audio in animation nodes. The current setup makes my models react in a very aggressive way to the audio. Is there a simple way to smooth the reaction ...
2
votes
1answer
87 views

Scaling a math function from a specific vertex

I have a model developed through a math function as shown below in the figure. I would like to scale the figure as shown in the figure without changing the vertex position. Explanation of the figure: ...
2
votes
1answer
2k views

Animate an object along the z-axis in a sin wave

So I wanted to make an animation of an object where it bobs up and down along the z-axis, like a sin wave on a graph. I understand one way of doing this with drivers, by which I add a driver to the ...
2
votes
3answers
118 views

Compositor: Get the second darkest value

I have an image that is mostly values between .3 and 1, but has a few areas of solid black. I want to set all the pure black areas (or perhaps near black to also catch aliased edges) to be the next ...
2
votes
1answer
592 views

How to get transform values that would be set from inserting visual key-frame for pose bones?

I have some bones with any number of constraints. I want to get the visual transform matrix of that bones that takes also into account when for example a stretch to constraint modifies that bone. So ...
2
votes
1answer
645 views

Particles and Random Numbers and Cycles Render

Goal. Have access to a random number in range [0-1] per particle per frame in a Cycles Render Node. Particle System is used. Multiple particles per frame. Question. How can Blender drivers/other ...
2
votes
1answer
282 views

How calc value of translate with constraint_orientation=“VIEW”?

I want to translate some vertices in X axis with constraint_orientation="VIEW" but I dont' know how calc the values??... next code should work but I don´t know how calc the value in this parameters ...
2
votes
1answer
94 views

Vector Math to Determine Gravity Path

I need to code a function that basically traces the path a sphere would roll when placed on a triangulated terrain. The image below shows the problem, but I haven't got a clue how to work with vectors ...
2
votes
1answer
682 views

Custom Colour Palette Node

Would it be possible to create a node that acts like a colour palette? Essentially I define the colours that I want it to have, and from there I can use them as I wish. I know that something like this ...
2
votes
1answer
271 views

Visualize radioactive gamma rays & their absorption in materials using cycles

there is a very nice tutorial showing the mathematics behind light absorption - the amount of light is getting less during it's move through colored material. - following the law of Lambert & Beer....
2
votes
1answer
25 views

Straightening Lines without Straightening Iron

Thanks for looking this over in advance. Hopefully pictures describe this somewhat well- but I'm looking to take the guess out of my guesswork here and have lines which are "perfectly straight&...
2
votes
0answers
70 views

Converting / getting parametric equation to work using python

Converting / getting parametric equation to work in Python / Blender / Animation Nodes I can create / plot the parametric equation in Octave $$x=u\sin(u)\cos(v)$$ $$y=u\cos(u)\cos(v)$$ $$z=-u\sin(v)-\...
2
votes
0answers
19 views

Get Normal data from smooth Normal

I don't know about "Shade Smooth", but I hope you can help me there. If the mesh has "Shade Flat", then you can read every face with "polygons [i] .normal". Can I also read the "normals" from the "...
2
votes
0answers
48 views

frame_change_post/pre not working when Rendering Animation [duplicate]

I've got this script file that works flawlessly in the viewport, but stops completely when I start rendering it as an Animation. ...
2
votes
0answers
51 views

How do you make a Lego statue out of a character Model?

I want to make a Lego esc statue out of a character Model. The character Model has a texture. My plan is to use the Remesh (Blocks) Modifier to make the Lego pieces. This works without a Problem. I ...
2
votes
0answers
107 views

Making a Moire pattern animation

I'm trying to animate a pattern I made. I made this on a graphing website called Desmos, but ran into problems making all the lines move. Apparently it's too computationally difficult for the website ...
2
votes
1answer
1k views

How to calculate intersection between two planes

I'm dipping my feet at Blender SDK, and I'm trying to calculate intersection between two planes: Created a default plane in center, duplicated, rotated second, scaled first, applied transforms; but I'...
2
votes
0answers
508 views

Practical use example of Dot product and cross product? [closed]

Edit : Problem Solved . Thank you I have read all Dot product and cross product related questions and answers. Thanks to explainations of some supportive community members Now I know what dot ...
2
votes
0answers
350 views

How to make a dodecahedron? [duplicate]

I would really like some help to make a dodecahedron! That means i would like to make a "ball" form made entirely of pentagons.
2
votes
0answers
429 views

Change rotation order of a matrix

So, I am writing an exporter to another scenegraph format. Trouble is I suspect it has a different order of rotation (not 'XYZ'). So how do I change a Blender Matrix 3x3 or 4x4 into one that has same ...
2
votes
0answers
68 views

Source to read about the math in World Matrix and Blender's use of quaternions?

I'm going to show some slides about using Blender to illustrate three dimensional and time-evolved physics simulations by just (pasting and) running the python within the blender user interface. ...
2
votes
0answers
726 views

How to intersect two planes?

I am trying to use the geometry.intersect_plane_plane function, but I can't use the results properly. On this tryout, we have two points (...
2
votes
0answers
447 views

Scripts: Converting Quaternions to Pre/Post Rotations

An issue that I've noticed while working on models for a specific game engine, is that when using exporting FBX models or BVH data comes the fact that you have two different rotations formats, with ...
1
vote
4answers
637 views

Is it possible to extrude along a curved path like those made by a spirograph?

I was looking at spirograph drawings and I was wondering if Blender has any way of extruding along such a path so that it could be turned into a mesh object. Here's a link to some spirograph pictures: ...
1
vote
2answers
76 views

Scripting alternative to editing colour based on vertex coordinates using Nodes editor

I am trying to add colour to a mesh object where the colour varies based on the z location of each vertex (similar to a heat map). I am able to do so using the nodes editor (cycles render) into ...
1
vote
2answers
6k views

Finding the closest point on a line defined by two points

I'm doing some simulation work using Blender/Python and I'm stuck on a geometry problem. What I want to do is: Define a line in 3D space based on two points. One of the points will always be the ...
1
vote
2answers
120 views

Make the dots the color of your logo

The grid shown below is what i have right now but it just overlays. I want the white dots to be using the image texture color. I have this method i have seen with simon tommes. Where he uses a image ...
1
vote
2answers
31 views

How can I make boundaries for a numerical value in the node editor?

I am trying to make a node setup where: If the input is 0 or anything less it outputs 0 If the input is 5 or anything greater it outputs 5 If the input is between 0 and 5 it outputs the input I can'...
1
vote
1answer
480 views

Obtain normal map from specific camera and transformation

This may be a long shot, but after researching fruitlessly for about two weeks, I wanted to ask here in the hopes that someone who is a bit more knowledgeable about Blender and computer vision can ...
1
vote
1answer
237 views

How to perform trig functions on a vector element-wise?

I'd like to get the cosine of all elements in a Vector in Blender's python. Should I just use numpy for this? Edit: I was tired when I wrote this and kind of mis-posed the question. What I actually ...
1
vote
3answers
80 views

Updating objects parameters using python creates multiple objects

I can update a text curve object when I change the frame and it doesn't create multiple objects but how can I do the same with a mesh object. Code: ...
1
vote
1answer
630 views

Spiral array but with fibonacci sequence

I am trying to make a sunflower. The seeds in a flower grow in a spiral. Whenever I add an array spiral and make it follow the curve, it doesn't seem to look quite right. This is because it doesn't ...