-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rotate and Scale #354
Comments
nice. usefull, i think |
add mirroring! |
Yeah! That is the next in what I was thinking! |
in |
do we need Vector2f Vector3f Vector4f? And what the hell is Vector4f? |
What is the meaning of vector2f or vector3f?? |
3 component float |
it's openGL notation, if i'm not mistaken. in openGL you could also have |
Oh, I understand now. GH has nodes to do that, define colours in RGBA or HSV. |
we not need to define colors with alpha for now.. not see why we need in future. And 4D vector as quaternion i not see now usage. it is for rotation, but why we need it? i don't think we need quaternion. what you think? |
but regime with corresponding rotation will be good - i.e. i writed first - when one center fits one vertex and one factor to one vertex, so we may have two regimes - two buttons as in UVconnection node!!! |
I think it a useful feature, also I wish we had per vertices matrix operations and per object so one could multiply many objects in the same list. Oh well. The rotation model you are using is called Axis, Angle in blender, I think it is good idea to use the same naming scheme. And has ready made matrix constructor in mathutils, def rotation(self, vertex, center, axis, angle):
mat = Matrix.Rotation(radians(angle), 4, axis)
c = Vector(center)
pt = Vector(vertex)
return c + mat ( pt - c) Instead of 51 lines (with comments and white space also.) On the other hand it is nifty to make it all into one matrix. For new code I think we should all follow pep8 naming conventions. |
The whole vertex2,3,4f thing. All our vectors/points are implicitly vertex4f when it comes to matrix multiplication. Sometimes it would be nice with 2d vectors I find myself thinking but not for so long. Also a Euler input mode and for completeness a Quarternion input would be nice I guess, to support the other rotations modes of blender. (We should also allow the creation of rotation matrices based on euler and quarternions) For me axis angle makes the most sense but for others Euler seems to be the way they think. |
@ly29 I just don't know yet blender inside that well, but I do know maths and geometry, so I did in that way. And doing it was so funny!! :) |
Hi guys. Is it possible to add a simple Rotation Node? For example i want to rotate an object to: As a common rotation in blender for all objects. Here is my setup: https://dl.dropboxusercontent.com/u/26887202/blender/Sverchok/test_rotation.blend And here how this Rotation Node should be: http://i.imgur.com/RepF8FI.png |
Euler rotations, yes |
If someone will add it as a one node. It would be super cool. Yes, Euler rotations. :) |
The rotate node as you suggest shouldn't be like that I think, that would be the matrix multiplication node (also todo), before that the should be a node creating a Euler Matrix, in any order of [‘XYZ’, ‘XZY’, ‘YXZ’, ‘YZX’, ‘ZXY’, ‘ZYX’] , either from vector input or as separate x,y,z. |
Yes matrix multiplication is ok too. I hope you guys will be able to add such a node. As at present it's a big pain to rotate objects. |
|
I've simplified both. I can now look into euler rotation in nobady else is alredy doing it. |
couple of things to remind concerning to rotations. in polygons centers there is problem with defining rotation. if @mifth can look at this node and code - some Y polygons are wrong rotated there. and second is defining matrix from three points (not existing yet node), it is the same task as centers of polygons, but with some difference in code... what you say, could you handle this, @mifth ? |
@nortikin @AgustinJB |
@ly29 yes, triangle |
Ok, I think we have an euler rotation node ready! :) PS: what a wonderfull world is Blender Documentation! |
@mifth can you test it now?? The problem wasn't about the code. The different results were about the gimbal order, so I've added a enum to select that order. I think now is pretty done. Maybe some simplification in inputs/outputs could be done, but I think that's all. Enjoy! :) |
Ohh......I've kind of misunderstood about quaternation...let me see that again to see if I can fix it |
i think, quaternion convinient for operating rotation inside code, not in user interface. am i right? |
It‘s good that it uses matrix. I mean second node on the screenshot. It can
|
Ok, now I think it works just like in 3d view: It's kind of tricky to understand quaternions... @ly29 I don't understand what you mean about the reorder of the inputs. |
@AgustinJB sorry for late responce. I tested. It seems Rotation Node works ok now. |
I'm glad to hear @mifth. I'll test it some more before pushing to master. In the meanwhile I'm trying with mirror node: |
@AgustinJB have a look at index visualizer (viewer_indices.py) |
Thank you for the tip @zeffii!! It's in early stages, but it works pretty well. Maybe I should add edge and poly inputs/outputs, and maybe study clipping and merging options. I've been looking at the source code of mirror modifier, but right now it's hard to understand to me, so I'm not sure if it could be usefull to the rest of the options. |
@AgustinJB will there be mirror from plane/point? because there are three type of mirror:
|
Also, if set scaleX = -1.0 to Matrix.... possibly it will be like a mirror? |
@mifth it is if you scale around local zero, but if you need define some other center point? |
then i dunno know :( |
@nortikin I'll look into that mirrors modes tomorrow. I also want to get clipping working. |
I've added clipping option. It need some fixing for multiple center inputs, but it works pretty well I think. Do you think edge/polys inputs/outputs should be added?? Right now it's needed just a list repeater. |
no need to add edges and polygons, but only for flipping normal (reverse plygons indexes) |
@nortikin I've been looking into those others symmetry methods. Are they the ones described in this web: http://www.mathsisfun.com/geometry/symmetry.html Because I think the last two can be made with rotation Axis/Angle, which is in rotation node. Maybe I can add the option to input a matrix to define an arbitrary plane of mirroring? |
@AgustinJB |
Uhmm, right, I see. Yep, I'll do that! |
1,2,3 points. depending on how many points it builds mirror. Or if matrix inserted in the same socket, it should consider it as plane, as three points. it is my proposal, but you make as you see |
total - two sockets - one for vertices, one for point/line/plane/matrix |
WOW!!!!!! will test |
when matrix not connected |
Oh, right, I forgot to add a default matrix. I'll add it later. |
I've been testing all the new nodes again and they seem to work properly. If you are ok, I will merge this branch with master, leaving new nodes in beta tab. |
yes |
Hi guys!
I know that matrix is a very powerful tool, but sometimes it's kind of difficult to use and understand. Thinking in that, I've made two nodes for general rotation and scaling in space. Both based on a center point, and rotation also in an arbitrary direction.
I've made a new branch so you can test it and tell me what you think.
The text was updated successfully, but these errors were encountered: