pass the bounds in uniforms to a custom shader,
in the vert shader pass the vert position to the frag.
if the coordiante in the frag is out of the bounds, dispose it (thats a actual instruction there)
It would be very easy to do with a custom mesh, but you must have a specific reason to want to show only a part of your box. Maybe you could explain in more detail what kind of functionality you need?
An alternative would be to use a texture map with alpha values, basically āpainting the ends transparentā, but if it is not a dynamic rendering, a custom mesh is the way to go.
Iām currently designing a Foldable display Prototyping Tool. Foldable displays are created in 2D then rendered in 3D using Jmonkey.
For example a foldable display composed of two panes (a diptych) must render a user interface on the entire surface. In this example the global user interface is divided in two parts each one displaying a part of the UI. The situation is depicted above.
I already have the foldable device working but now I want to display UI on it.
The way a thought about this is to have a UI composed of Windows, buttons, etc represented in 3D using thin 3D boxes. Each pannel (screen) would have an instance of the full UI but would only show one part of it. Itās here that I would use the functionality of displaying only one part of a shape.
If I used Unit3D pro I would have use render texture functionality but I dont think itās possible in JME3ā¦
I donāt know if itās the best way to do it but at least itās an idea.
But I have a pretty straightforward question but I canāt find informations about that in forum a tutos: How can I simply move the texture coordinates of a texture?
I used geom.getMesh().scaleTextureCoordinates() to scale the texture but I donāt know how to place the texture at the desired location on a geometry.
Also, the source code for everything is available in only a few clicks. So if scaleTextureCoordinates() almost did what you wanted it was a good place to look to see how you could write your own that did exactly what you wanted.
Itās frustrating sometimes how many users stop right at the API when going one step further would answer their question.