PolygonVBO/TriangleVBO

37 views
Skip to first unread message

Dominik Scharnagl

unread,
Jul 14, 2022, 9:12:10 AM7/14/22
to Jzy3d
Hello,

I have a big amount of vertices I have to traverse and create an object from, that I get from a COLLADA file (.dae).
With normal primitives it workes fine for one set of vertices but with multiples I just get a white screen, so I try to use VBO primitives.

Problem is now I don't quite understand them.
I converted the vertices I had into Coord3ds and always tried to put 3 of them together to get a triangle.
I put 3 Coordinates then into a list to use the VBOBuilderListCoord3d loader to create a PolygonVBO/TriangleVBO, but fore some reason the axis shows up, but I can not see anything.
After trying a bit so I saw, that when I gave the VBOBuilder 5 Coords then a Triangle showed up but not with less and now I am confused.

So how can I make a PolygonVBO or a TriangleVBO with 3 Coord3d points that are the edgepoints for that polygon/triangle.

Sincerly,
Dominik

Martin

unread,
Jul 14, 2022, 9:31:05 AM7/14/22
to Jzy3d
Hi Dominik,

It is hard to diagnose without a sample code to reproduce your problem.

I suggest you go on with DrawableVBO2, which is much more flexible in terms of data model and has been used in more applications.

I got example codes that I could add to the developer guide if you are interested.

Regards,

Martin

Dominik Scharnagl

unread,
Jul 15, 2022, 4:52:00 AM7/15/22
to Jzy3d
Hello,

thanks for the fast answer. I am gonna try it with DrawableVBO2 and see if it works.

Regards,

Dominik

Dominik Scharnagl

unread,
Jul 16, 2022, 8:40:04 AM7/16/22
to Jzy3d
Hello,

Thx. DrawableVBO2 seems to work great for the performance.

Sincerly,
Dominik

Martin schrieb am Donnerstag, 14. Juli 2022 um 15:31:05 UTC+2:

Dominik Scharnagl

unread,
Jul 17, 2022, 7:14:03 AM7/17/22
to Jzy3d
Hello,

so I have used DrawableVBO2 now and I have the problem, that it looks kinda transparent and not really like a solid object. (Even when setting the Material Ambiant/Diffuse/Specular, it still looks that way just in a different color).

Is there away to make it not look transparent?

Sincerly,
Dominik

Martin schrieb am Donnerstag, 14. Juli 2022 um 15:31:05 UTC+2:
Ex1.PNG
Ex2.PNG

Martin Pernollet

unread,
Jul 17, 2022, 7:20:48 AM7/17/22
to jz...@googlegroups.com
Hi,

Did you try setting the color with non alpha channel ? Maybe you are using the default color which has an alpha channel .

When you will have solid color you will want to chart.addLight... to better visualize the volume

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Jzy3d".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jzy3d+un...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/jzy3d/82b415fd-2ce0-4151-a4ac-2cd3d773bdf9n%40googlegroups.com.

Dominik Scharnagl

unread,
Jul 18, 2022, 7:22:34 AM7/18/22
to Jzy3d
Hello,

I tried it with setting the color and material with and without the alpha channel. This was the code for setting the color (without the alpha channel).
       
        vbo.setMaterialAmbiantReflection(new Color(material.getAmbient().x, material.getAmbient().y, material.getAmbient().z));
        vbo.setMaterialDiffuseReflection(new Color(material.getDiffuse().x, material.getDiffuse().y, material.getDiffuse().z));
        vbo.setMaterialSpecularReflection(new Color(material.getSpecular().x, material.getSpecular().y, material.getSpecular().z));
        vbo.setColor(new Color(material.getAmbient().x, material.getAmbient().y, material.getAmbient().z));

We are using chart.addLight. That part looks like this:

         Light light = chart.addLight(chart.getView().getBounds().getCorners().getXmaxYmaxZmax());

But it still looks transparent. Do I have to give the light some special characteristics it is missing?

Sincerly,
Dominik

Martin

unread,
Jul 29, 2022, 9:21:45 AM7/29/22
to Jzy3d
Hi,

I confirm that DrawableVBO and DrawableVBO2 both have a default pink color with alpha=0.75, so I presume you still use the default value despite your setColor(...)

A quick fix is to globally disable alpha with 

Quality q = Quality.Advanced().setAlphaActivated(false)

Why does your object keep being translucent whereas you changed the color? Maybe you modified the color AFTER adding the drawable to the chart. When a VBO is added to the chart, and if the chart is already opened, the data and properties will be transferred to GPU. One done, changing properties and data won't change, unless one destroy and rebuild the VBO content (which is not supported yet).

You can look at the guide sample relating to VBO in this new version of the guide online.

Best,

Martin


Dominik Scharnagl

unread,
Jul 30, 2022, 4:37:58 AM7/30/22
to Jzy3d
Hello,

yes thanks setAlphaActivated to false solved the issue.

Sincerly,

Dominik
Reply all
Reply to author
Forward
0 new messages