Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. NesNes
    N
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 7
    • Best 0
    • Controversial 0
    • Groups 0

    NesNes

    @NesNes

    0
    Reputation
    13
    Profile views
    7
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    NesNes Unfollow Follow

    Latest posts made by NesNes

    • RE: VoxelizationInterface

      Thank you Manuel !! this is exactly what I was looking for 😊

      posted in Cinema 4D SDK
      N
      NesNes
    • RE: VoxelizationInterface

      Hi Manuel,

      for instance, I want to create spheres at the voxels' locations and make the ones touching the polygon red and the others gray.

      posted in Cinema 4D SDK
      N
      NesNes
    • RE: VoxelizationInterface

      Thanks to both of you for your answers!

      voxelResolution, minResolution : 👍
      maxon::Range: seems I have a lack of sleep 😰

      Last question (I hope),
      Since the "object space" is divided into cells/voxels (based on the voxelResolution), is there any way to loop through all cells or get access to a specific one ?

      Thanks again

      posted in Cinema 4D SDK
      N
      NesNes
    • RE: VoxelizationInterface

      First of all, thank you for your answer!

      Just like I said in my previous post, I want to get more details on the VoxelResolution, and minResolution args.

      Here an example of what I did to get bounding boxes of all polygons:

      …
      // voxelResolution    The voxel resolution of the largest dimension.
      // minResolution      The minimal resolution of either dimension.
      
      maxon::BaseArray<maxon::Range< Vector >> polyRanges;
      auto result = voxRef.Init(currentObj, 10, 1, polyRanges);
      …
      

      This code works fine and polyRange is correctly populated.

      As you can see, I set VoxelResultion to 10, it’s an arbitrary choice (Why 10 and not 100 or 1 ? … meh..). In the beginning I thought that this parameter is to define the voxel size, but since It’s an Integer parameter and the calculation time increases by increasing this number, I suppose that VoxelResultion is reacting more like a subdivision or a number of iterations, and in that case, what “Resolution and Dimension” the documentation is referring to?

      And the same thing with the minResolution parameter…

      On the other hand, the Init method returns a list of maxon::Range elements, each one represents the bounding box of a polygon. But I don’t know how to exploit it.

      Example:
      If we have a polygon with 3 points A, B and 😄

      The maxon::range seems to store something like this:

      _minValue: { min(A.x, B.x, C.x), min(A.y, B.y, C.y), min(A.z, B.z, C.z) }
      _maxValue: { max(A.x, B.x, C.x), max(A.y, B.y, C.y), max(A.z, B.z, C.z) }
      

      So, how to convert this to a classic Bounding Box data ( i.e a center + a radius) just like with GetMp() and GetRad() for an object...or maybe… I misunderstand something 😕

      Thank you.

      posted in Cinema 4D SDK
      N
      NesNes
    • VoxelizationInterface

      Hi,

      I continue my tests on the C4D API with the VoxelizationInterface, and I'm already stucked at the first method 😞

      MAXON_METHOD Result<Bool> Init (PolygonObject*	polyObject, Int32 voxelResolution, Int32 minResolution, BaseArray< Range< Vector >> & 	polyRanges,
      const Vector * 	pointOverride = nullptr, Boolprecise = false )		
      
      // Initializes the voxelization with a polygon object.
      
      Parameters
      [in]	polyObject	Pointer to the polygon object to be added to the voxelization.
      [in]	voxelResolution	The voxel resolution of the largest dimension.
      [in]	minResolution	The minimal resolution of either dimension.
      [out]	polyRanges	Calculated bounding boxes for every polygon.
      [in]	pointOverride	Override option for the polygon points. If not nullptr, these points will be used for the polygon vertices.
      [in]	precise	If true, only the voxels touching a polygon will hold the specific polygon index. If false, all voxels touching the polygon AABB will hold the polygon index.
      Returns
      True if the voxelization was properly initialized, false otherwise.
      

      Even after reading the description, I can't figure out what are exactly voxelResolution and minResolution, and how to interpret the maxon::range values (i.e min and max values) in an AABB context ?

      Can somebody help me to understand this please ?

      Thank you !!

      posted in Cinema 4D SDK r20 sdk c++
      N
      NesNes
    • RE: DistanceQuery

      thank you so much!!

      posted in Cinema 4D SDK
      N
      NesNes
    • DistanceQuery

      Hi,

      I'm trying to understand how to use the DistanceQueryInterface.

      Does anyone have an example of this?

      Thanks

      posted in Cinema 4D SDK c++ r20 sdk
      N
      NesNes