Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi Ferdinand, thank you for your detailed reply. I am looking for hit point. Then if I understand well, my only way would be to use GeRayCollider on all objects ?
Best,
Hi guys, I would like to compute the distance from a point to a mesh while editing a document.
Requested method: - [IN] start point - [IN] direction vector - [IN] radius (area to look) - [OUT] position of a hit if it exist (or a distance to the starting point).
Current plugin structure implementation:
MessagePlugin objects' scene coordinates.
Example:
Here I would like to know the first element which is hit by the blue line from the camera. I took here the camera to have a visualization, however it can be a random start point.
I considered few options:
Do you have any hint or recommended method to do that?
Thank you in advance Best
@cairyn Thank you!
Hello guys, I am working with cameras to do some computation I need to retrieve its current view volume. I call view volume, the visible scene's "cone" from the camera pov. See picture below (this cone is visible when the option "Show Cone" in camera object is switched on):
Does it exist a function returning this volume no matter what kind of camera is used?
While I can compute it for perspective camera, I couldn't guess the right parameters to compute it for parallel camera.
struct frustum{ Float farVal, nearVal, right, left, top, bottom; }f; cam = GetCamera()) { Float near = 0; Float far = 1000; Float focusLength= getParam(CAMERAOBJECT_TARGETDISTANCE, DA_REAL, cam).DReal; if (getParam(CAMERAOBJECT_NEAR_CLIPPING_ENABLE, DA_LLONG, cam).DLLong != 0) { near = getParam(CAMERAOBJECT_NEAR_CLIPPING, DA_REAL, cam).DReal; } if (getParam(CAMERAOBJECT_FAR_CLIPPING_ENABLE, DA_LLONG, cam).DLLong != 0) { far = getParam(CAMERAOBJECT_FAR_CLIPPING, DA_REAL, cam).DReal; } auto fov_vertical = getParam(CAMERAOBJECT_FOV_VERTICAL, DA_REAL, cam).DReal; auto widthHalf = focusLength * maxon::Tan(fov / 2.0)/100.0; auto heightHalf = focusLength * maxon::Tan(fov_vertical / 2.0) / 100.0; f.farVal = far; f.nearVal = near; f.right = widthHalf; f.left = -f.right; f.top = heightHalf; f.bottom = -f.top; return 0; }
Any help is welcome. Thank you in advance
Thank you m_adam it works perfectly ! Here is the code if it helps someone
AutoAlloc<AtomArray> pList; FilterPluginList(pList, PLUGINTYPE::COMMAND, true); for (size_t i = 0; i < pList->GetCount(); i++) { auto elem = static_cast<BasePlugin*> (pList->GetIndex(i)); DiagnosticOutput(elem->GetName()+ ", "+ String::IntToString(elem->GetID())+ ", " + GetCommandHelp(elem->GetID())); }
I have also another question, before I was trying to discover commands thought the menu then I could categorize it. Do you think there is a way to collect such information (for instance know that "New project" command is located into file submenu.
Thanks
Hello Guys,
For now I understand from different forum posts that the only way is to get it from the command palette (for instance in https://plugincafe.maxon.net/topic/3168/2548_command-id/2) For now I am doing this kind of recursion to get a list of command from the ui. The code below shows me two kind of results:
1. IDM_XXX 2. PLUGIN_CMD_${ID}
The first one is a string while the second contains an id but does not corresponds to the targeted command id.
void EnumerateCmds(BaseContainer* item) { BrowseContainer bc(item); Int32 id = 0; GeData* dat = nullptr; while (bc.GetNext(&id, &dat)) { switch (id) { case MENURESOURCE_SUBMENU: DiagnosticOutput("SUBMENU ["); EnumerateCmds(dat->GetContainer()); DiagnosticOutput("]"); break; case MENURESOURCE_STRING: DiagnosticOutput("MENURESOURCE_STRING " + dat->GetString() + "["); EnumerateCmds(dat->GetContainer()); DiagnosticOutput("]"); break; case MENURESOURCE_COMMAND: DiagnosticOutput("MENURESOURCE_COMMAND=" + dat->GetString()) break; case MENURESOURCE_SEPERATOR: break; case MENURESOURCE_SUBTITLE: DiagnosticOutput("subtitle="+ dat->GetString()); break; case MENURESOURCE_MENURESOURCE: DiagnosticOutput("MENURESOURCE_MENURESOURCE=" + dat->GetString() + "["); EnumerateCmds(dat->GetContainer()); DiagnosticOutput("]"); break; case MENURESOURCE_SUBTITLE_ICONID: DiagnosticOutput("MENURESOURCE_SUBTITLE_ICONID id value: " + dat->GetInt32()); break; case MENURESOURCE_ASSET: DiagnosticOutput("MENURESOURCE_ASSET" + dat->GetString() + "["); break; default: DiagnosticOutput("error"); break; }
Thank you in advance for any help
Best