[Solved] Indexed triangles, going beyond the custom mesh tutorial

Hello all,



I’m building a custom mesh, I’ve gone through the custom mesh tutorial.

Now need to go a little beyond that and build a strip.



While just building more quads next to one another is an option, that would generate some overlapping information (the sides connecting two contiguous triangles).

Usually overlapping information means lower performance but I don’t know how jMonkey deals with this.

Will it lead to lower performance?



An option would be indexed triangles. How do I do that?

Is generating a Quad with 6 or 8 vertices a good idea?

This isn’t specific to jme, theres lots of info about meshes online.

@normen what I I want to use is the Quads in the tutorial. What I don’t know is what steps should I take to optimize number of Geometries.



This question arises from the section Maintain low Geometry count.

I’ve tried to do some inverse engineering from GeometryBatchFactory.mergeGeometries() since it is called from optimize(), but it’s quite complicated for someone who doesn’t understand the inner workings of the engine yet.



Calling the optimize method is an option of course but after looking at how much stuff it does I think if I could make it from start would be better.

It just puts all meshes into one… And yes, if you don’t understand this then nothing will help you properly I guess.

@normen It just puts all meshes into one..

Yes, the name of mergeGeometries() kind of points in that direction...

@normen And yes, if you don’t understand this then nothing will help you properly I guess.

So what you are saying is if I don't understand the inner workings of GeometryBatchFactory.optimize() I shouldn't even bother trying to optimize my scene?

No, generating your own meshes… To use it you don’t need to look at the code…

@normen Hmm bad wording. With optimize my scene I meant building a custom mesh.



But I probably asking in a way nobody understands or cares.



Honestly all I was asking was something like set you should set these buffers and these variables with values that correspond to this.

Even just a RTFM on this link would be awesome.



I can’t find the manual and the docs aren’t helping either.

I can’t find anyone asking similar questions on the forum.

I’m not just trying to be annoying to spend my free time.

Again, meshes and the buffers contained and how they describe triangles etc. isn’t a jme specific topic. You can find information about this all over the web using :google:

@normen Yeah, because if I made all these posts I didn’t bother to do that.



It’s like you take joy in not answering.

:roll: There, from this Wikipedia entry you get all information you need about how these meshes are constructed: http://en.wikipedia.org/wiki/Triangle_mesh

How should I know how your values should be… they describe the mesh you want to construct :? If you need double vertices at the corners depends on your textures and texture coordinates for example.

@kotoko said:
@normen Yeah, because if I made all these posts I didn't bother to do that.

It's like you take joy in not answering.

It is more like normen is the only one that troubles to answer because all you need to know are in the tutorial. Well, the tutorial assumes you know that a mesh consists of vertices and indices. Which is not a jME-thing. It is fundamental 3D-knowledge that you can find a _lot_ of tutorials on all over the internet. Wikipedia is a good start and then google. Search for triangle mesh, OpenGL and triangle winding.

Alright, I’m not here to pick up a fight or being impolite.



I’ll re-read everything I can find on meshes and do the custom meshes tutorial, again.

Maybe at least I’ll understand why you think this is the problem.

What was going on was this:

I was messing up the indexes and it looked as if only the first quad was being generated. (Hence my conviction I didn’t understand all the methods I needed to call).



I had done a lot of google researches, read lots of posts, did the custom meshes tutorial and read all the related tutorials. This was why I was angry at being taken for the random idiot that is too lazy to do his homework.



You couldn’t possibly guess what was my problem but you could believe me when I said I read the stuff instead of being condescending.

1 Like

Thanks for giving this update. I was only telling you that the info you need is generic as you were asking for information in the manual. QED, you now know more about meshes and were able to solve your issues :slight_smile: The “roll” emote was because of your accusation that I “take joy in not answering”. Idk why people think that I want to troll them all the time but I tell you the same thing I’d tell my personal friends. There were no questions that one could give a definitive answer to, only “you need to know more about the topic to solve this, the info is not found on this site”.

IMHO since you give such short answers it’s hard (at least for me) to understand what you mean.

Since it’s so obvious you know your stuff, hence probably the answer, it’s a bit unnerving.



Now that I know what was going on, reading this posts is almost like watching an accident happen lol

@kotoko said:
IMHO since you give such short answers it's hard (at least for me) to understand what you mean.
Since it's so obvious you know your stuff, hence probably the answer, it's a bit unnerving.

Now that I know what was going on, reading this posts is almost like watching an accident happen lol

I only mean what I say and if theres no emote you can be 100% sure theres no hidden thoughts :)
1 Like
@kotoko said:
IMHO since you give such short answers it's hard (at least for me) to understand what you mean.
Since it's so obvious you know your stuff, hence probably the answer, it's a bit unnerving.

Now that I know what was going on, reading this posts is almost like watching an accident happen lol


The internet (and the whole world) is a much nicer place if you interpret things in the best light possible. If there is a way to interpret something as not being insulting or condescending then interpret it that way. It doesn't matter if that's the intent or not because life will be better and the other person's true opinion doesn't matter that much. This technique is not always easy but it's always better.

In this case, there was not enough information for us to help you find the bug in your code. No simple test case. No well formed answerable questions. The only questions we got were things already answered in the tutorials so we had no choice but to either point you back to them or try to describe them in a better way. Either way it would not have solved your problem because we lacked the proper information.

As a bit of advice, if you had posted the code that wasn't working (after having read the tutorials, etc. and felt like you thought there was some hidden method you didn't know about) then you probably would have had four or five spot-on answers pointing to the bug in your code.
2 Likes

That’s true.

I should have done the old MWE.

1 Like