|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: How to find the vertices of a 3D shape? |
|
| Print at Dec 16, 2025, 11:35:06 AM | |
| Posted by enkonyito at Oct 30, 2018, 11:15:15 PM |
|
How to find the vertices of a 3D shape? Hi, I want to automatically find the vertices (coordinates and indices) of a 3D shape. I am currently studying methods related to exportNode of PhotoRenderer.java or writeNode of OBJWriter.java. Is it a good starting point even if it is not easy to know what to keep or not? The goal is to be able to use this information for TriangleMeshLight light sources. Enko ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Nov 3, 2018, 10:26:08 PM |
|
Re: How to find the vertices of a 3D shape? For SH3D lights, the types of geometric constructions detected are: - TriangleArray (like the opaque light panel) - LineStripArray (like the unviewable light panel). Using, GeometryInfo geometryInfo = new GeometryInfo (geometryArray);java.lang.IllegalArgumentException: Unsupported geometry typeSunflow only considers triangle-based meshes for TriangleMeshLight light sources. light {---------------------------------------- EnkoNyito |
| Posted by Puybaret at Nov 4, 2018, 6:49:43 PM |
|
Re: How to find the vertices of a 3D shape? Without knowing what you stored in geometryArray, it's impossible to understand what is wrong. If you look for simple examples, you could look at this tutorial and at the source code of ShapeGenerator plugin. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by enkonyito at Nov 5, 2018, 5:31:34 PM |
|
Re: How to find the vertices of a 3D shape? I use your tutorial to complete my information on the Javadoc of Java3D. In geometryArray, the data about the object of any shape that I want to find the vertices is stored. [...]The ideal would be to force to use TRIANGLE_ARRAY. ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Nov 20, 2018, 8:13:22 PM |
|
Re: How to find the vertices of a 3D shape? To have a reference of what I had to look for, I performed tests in Sunflow directly by editing the example_scene.geo.sc file. I have found that vertices are only well taken into account if they are grouped into a single object defined in the .obj file. # 3D model cube_v2.objResults in Sweet Home 3D. By launching the rendering several times, sometimes the triangle mesh light is not well applied. I think I should put my method searchVertices (light) elsewhere than in exportLightSource especially since there is redundancy with some methods already present in the PhotoRenderer file. ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Nov 26, 2018, 12:15:56 AM |
|
Re: How to find the vertices of a 3D shape? Using or modifying existing methods in the PhotoRenderer class optimizes the dynamic search for coordinates and vertices indices of a 3D shape. The quality and duration of rendering depends on the composition and complexity (number of triangular faces) of the object transforming into light. Neon digits (created by alaX) SH3D models ---------------------------------------- EnkoNyito |
| Posted by ndorigatti at Nov 26, 2018, 9:35:14 AM |
|
Re: How to find the vertices of a 3D shape? So, let me understand.. are you finding a way to speed up rendering or trying to find a render result different than before? |
| Posted by enkonyito at Nov 26, 2018, 6:50:47 PM |
|
Re: How to find the vertices of a 3D shape? Unfortunately, I do not think it is possible to speed up the rendering with Sunflow. On the other hand, I found a way for Sweet Home 3D to take into account the mesh light rendering . ---------------------------------------- EnkoNyito |
| Posted by ndorigatti at Nov 26, 2018, 8:15:11 PM |
|
Re: How to find the vertices of a 3D shape? So that you can have the whole mesh to light up? Could be interesting for my Philips homroo light model, where the glass part would be a mesh light! |
| Posted by Puybaret at Nov 26, 2018, 9:23:14 PM |
|
Re: How to find the vertices of a 3D shape? sometimes the triangle mesh light is not well applied. Maybe this could be bound to triangles orientation. Did you try to reverse the order of the vertices?---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by enkonyito at Nov 27, 2018, 3:53:02 AM |
|
Re: How to find the vertices of a 3D shape? @ndorigatti So that you can have the whole mesh to light up? Could be interesting for my Philips homroo light model, where the glass part would be a mesh light! Yes it's the whole object that lights up like a 3D silhouette.For your model, perhaps you could extract the glass part to turn it into light and then group it to the rest. @Puybaret Maybe this could be bound to triangles orientation. Did you try to reverse the order of the vertices? By reversing the order of the vertices indices of each face, the emission of the light is oriented on the opposite side.As there is no change of the scene (several geometric shapes) between each rendering (without closing the photo panel), I wonder if Sunflow would not keep some parameters in memory (after Java 3D export) which would have the consequence a random rendering. Especially with only one geometric shape present in the scene, the rendering is always correct. triangle mesh light_geometric shape.sh3d For those who want to test the mesh light rendering, first add these keys and their property values lightSourceX#n=0Then install the PVR-1.7betaTest plug-in (simple photo rendering only). ---------------------------------------- ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Jan 24, 2019, 10:15:43 PM |
|
Re: How to find the vertices of a 3D shape? Have you been able to turn objects into a triangle mesh light library? How are they rendered? Do you find this feature useful as a future version of the photo plug-in? ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Mar 7, 2019, 12:44:54 AM |
|
Re: How to find the vertices of a 3D shape? As this beta version of the plug-in is not 100% functional and does not seem to interest anyone, I do not think it will be made public. ---------------------------------------- EnkoNyito |
| Posted by enkonyito at Mar 10, 2020, 3:43:43 AM |
|
Re: How to find the vertices of a 3D shape? With the YafaRay rendering engine it is no longer necessary to search for the coordinates of the vertices of an object. Just use meshlight type light with the object ID . ---------------------------------------- EnkoNyito |
|
|
Current timezone is GMT Dec 16, 2025, 11:35:06 AM |