Login  Register

how to transform objects not using Transform3D

Posted by Mr. Broccoli on Dec 02, 2021; 11:45pm
URL: https://forum.jogamp.org/how-to-transform-objects-not-using-Transform3D-tp4041515.html

Hi All,

Trying to figure out how can I implement transforming elements that already went 'live', but not using Transform3D.
Searching for transformations in Java3D just points me to Transform3D 'way' and I need to do the leg work.

What I do now is group Points3d into a LineArray and then into a Shape3D and then add them to a BranchGroup.
This allows me to display these wireframe cubes on the screen.

I went through some APIs for a SimpleUniverse, Canvas, Locale, BranchGroup trying to find a method that would allow me to clean the display, (transform basic points in the background) and display refreshed objects, but to no avail.

I tried using SimpleUniverse->Locale->BranchGroup and then using SU.removeAllLocales() on a key press, but I'm missing something as the window does not refresh and I see 'old' cubes. I don't know what to expect.
I couldn't find how this method is supposed to work in detail, except for a succint description that just expanded this method's name. The name is promising :)

I also tried smash&grab method of just creating a new object, but it gets created in a new (default) frame.
Maybe somebody could tell me how to keep it in the same frame? Haven't done anything with frames so far, but that could do (even though it feels wrong). I don't need to make it ideal, just working.

Maybe there is a way to extract points back in an orderly manner after placing them in a BranchGroup?

Attached is what I have now.
This is not finished, I'm struggling as I lack a general concept of how to omit Transform3D usage.

I would be thankful if somebody could point me the right way.

Commenting on attached files:

On key press 'a' new object gets created with a new universe and a small translation.
On key press 'c' I was trying to see what removeAllLocales() really does, but nothing visible happens.

There's a bunch of RealMatrix methods in tuval1 that I'm intending to use for transformations, but right now they don't matter and tuval1 is just for 'new tuval7()'.

tuval1.java
tuval7.java
cube_creation.java


Kind regards, Mr. B.