@ferdinand Thank you very much for your continuous help in the past two days. I just searched axis related content in cafe, and it is confirmed that my idea is wrong. You are a patient and good teacher. Thank you again, Ferdinand.
Posts made by Neekoe
-
RE: How to change polygon axis
-
RE: How to change polygon axis
@ferdinand Hello ferdinand
thank you very much for the python matrix manual you provided me yesterday. I have solved this problem so far. However, there is a new problem. I hope that my axis can become vertical like the model, similar to the world coordinates. How to set my axis? Thank youconst Vector xNor = xPos.GetNormalized(); const Vector yNor = yPos.GetNormalized(); const Vector zNor = zPos.GetNormalized(); const Matrix m = Matrix(Vector(1,0,0),xNor, yNor, zNor); const Matrix inverseMat = ~m; op3->SetMg(inverseMat); const Matrix cuttomM = Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1), Vector(0, 0, 0)); //No response at this step op3->SetModelingAxis(cuttomM); ApplicationOutput(" m is @", inverseMat);
-
How to change polygon axis
Hi Guys:
I'm sorry. Ferdinand told me that I should check the python matrix manual. After checking it, I thought that the python matrix was very easy to understand, but could not be applied to the c++ matrix, which made me very confused. I've been worrying about this problem for four days. I hope that I can set the matrix through two points and set my axis. Next, I use pictures to explain my problem. If I can provide the c++ code, Thank you very much (there may be some problems with the software translation I use. Please forgive me).
thx!
-
RE: Custom convert matrix to polygon
@ferdinand I think I understand. I'm trying to convert now. Thank you for your continuous answers
-
RE: Custom convert matrix to polygon
@ferdinand thx ferdinand,The example I wrote above is feasible in other software. Maybe Maxon has its own matrix method. I am looking for a way to implement this example through C4d c++. The matrix in the SDK gives me a headache. I need a 3*3 matrix
In addition, I found that my title was wrong, not "custom convert matrix to polygon", but "custom convert matrix to polygon". Thank you very much for helping me merge posts -
Custom convert matrix to polygon
Hi Guys:
I hope to get an inverse matrix through two points, and then give this matrix to my model. So far, I have got two "vectors (point postion)". I'm sorry, I'm a novice in c++ and I'm confused by multiple matrices. I hope to get good results like the example below. Thank youv@my_y = normalize(@P-point(1,"P",0)); v@my_x = normalize(cross({0,1,0},v@my_y)); v@my_z = normalize(cross(v@my_x,v@my_y)); 3@mm = set(v@my_x,v@my_y,v@my_z); @P *= invert(m); SetModelingAxis
Vector up = Vector(0,1,0); Vector yPos = Normalize(point1Pos-point2Pos); Vector xPos = Normalize(Cross(up,yPos)); Vector zPos = Normalize(Cross(xPos, yPos));
edited by @ferdinand:
@Neekoe said:
I want to customize my axis through this method, thx
-
RE: Get Point selection tag center
@m_magalhaes Thank you, I think I understand
-
RE: Get Point selection tag center
@m_magalhaes Hi,m_magalhaes, I want to call your name again, because the last question is also your answer and has perfectly solved my problem. You are my God. Thank you very much.
Can I ask another question? Last night, I found that my tag name may be unclear. I want to use my own name. But gettagdata is not a member of baselist2d. I tried to browse the API, but I couldn't find the answer. For example, findcustomgui, which can be clearly known in the SDK, belongs to getdialog
-
RE: Auto fill selection tag to link
@m_magalhaes
thank you so much,you and your code is perfact
-
RE: Auto fill selection tag to link
@m_magalhaes
Oh, no, I'm really excited. Thank you very much. I'm looking at my code in your way now
-
Get Point selection tag center
Hi Guys:
I don't see the point position data that can be returned in "gettagdata",I hope I can get the center position of the selected point or point group. At present, I have set a link window in the dialog box. I hope I can drag my point group label to reach the link, and then calculate a center according to the linked point group (similar to forming a new bound and then getting the center). Plz
Thank you```
.....case IDC_LINKBOX2 :
{
GePrint("aaa"_s);
// Test can get response
break;
} -
Auto fill selection tag to link
Sorry, my English is not very good. Maybe I can't describe my problem very well. I am currently learning to make a simple plug-in. I hope to select a point, click a button, and create a selection tag. This step has been completed, but I hope to automatically link to my linkbox when creating a tag (I have an "addcustomgui_linkbox").
thank!
Bool MatrixAlignDialog::CreateLayout() { SetTitle("Matrix Align"_s); GroupBegin(0, BFV_SCALEFIT | BFH_SCALEFIT, 2, 0, "Select Object"_s, 0); { GroupBorderSpace(5, 5, 5, 5); GroupBorder(BORDER_GROUP_IN); AddStaticText(IDC_LINKBOX1_TEXT, BFH_RIGHT | BFH_FIT, 100, 20, "Object"_s, 0); AddCustomGui(IDC_LINKBOX1, CUSTOMGUI_LINKBOX, String(), BFH_SCALEFIT, 250, 10, BaseContainer()); } GroupEnd(); GroupBegin(0, BFV_SCALEFIT | BFH_SCALEFIT, 3, 0, "Set Start Group"_s, 0); { GroupBorderSpace(5, 5, 5, 5); GroupBorder(BORDER_GROUP_IN); AddButton(IDC_BUTTON1, BFH_SCALEFIT, 150, 20, "Set Point"_s); AddStaticText(IDC_LINKBOX2_TEXT, BFH_RIGHT | BFH_FIT, 100, 20, "Start Group"_s, 0); AddCustomGui(IDC_LINKBOX2, CUSTOMGUI_LINKBOX, String(), BFH_SCALEFIT, 250,10, BaseContainer()); } GroupEnd(); GroupBegin(0, BFV_SCALEFIT | BFH_SCALEFIT, 3, 0, "Set End Group"_s, 0); { GroupBorderSpace(5, 5, 5, 5); GroupBorder(BORDER_GROUP_IN); AddButton(IDC_BUTTON2, BFH_SCALEFIT, 150, 20, "Set Point"_s); AddStaticText(IDC_LINKBOX3_TEXT, BFH_RIGHT | BFH_FIT, 100, 20, "End Group"_s, 0); AddCustomGui(IDC_LINKBOX3, CUSTOMGUI_LINKBOX, String(), BFH_SCALEFIT, 250, 10, BaseContainer()); } GroupEnd(); GroupBegin(0, BFV_SCALEFIT | BFH_SCALEFIT, 3, 0, ""_s, 0); { GroupBorderSpace(5, 5, 5, 5); GroupBorder(BORDER_GROUP_IN); AddButton(IDC_BUTTON3, BFH_SCALEFIT, 150, 20, "Reset Pivot"_s); } GroupEnd(); return true; } Bool MatrixAlignDialog::Command(Int32 id, const BaseContainer& msg) { switch (id) { case IDC_BUTTON1: { // run the code for IDC_BUTTON1 const Int32 commandID = 12552; if(IsCommandEnabled(commandID)) { CallCommand(commandID); } break; } case IDC_BUTTON2: { // run the code for IDC_BUTTON2 const Int32 commandID = 12552; if (IsCommandEnabled(commandID)) { CallCommand(commandID); } break; } case IDC_LINKBOX2: { // get point selection tag break; } default: { break; } } return true;