Want to rotate the cylinder panel either left or right on clicking the button

https://www.babylonjs-playground.com/#HB4C01#8 .
want to rotate the cylinder panel either left or right on clicking the button or i want to know how to do this manually .

I want to actually take control of camera and dome and also cylinder to manually move them at will . kindly help me here . http://snvdev.website/wp/newarvr/

also i not only want to rotate it i also want to fix position , so that every time things come as i want it , example first i want to see portfolio in front of screen when website loads.+ radiance written at back.

Hi Amit! I am not very experienced in GUI3d, and I am barely started testing…


I put onClick handler in line 29, added button-down observer to each button in line 40, and carefully watching line 30 to console.

I haven’t yet learned HOW to determine WHICH button got pressed. bjsevt object arriving in onClick handler… does not contain very much information (such as .source).

Docs and playground demos therein… seem to be short-on “observing” demo-code. Still testing things, searching playgrounds, and reading sources.

A bit later, we can try animation function in lines 1-7… to align camera with picked button.

I will report progress. Smarter people than I… will be arriving on-forum soon. Stay tuned.

1 Like

hi Wingnut , Even i can do that with something like

button1.onPointerClickObservable.add( ()=> {
dome.rotation = (new BABYLON.Vector3(0, 10, 0));
plane.isVisible = false;
plane.notRenderable = true;

but main thing is i want to rotate cylinder panel & arc camera on its axis .

1 Like

nod. Thx for clarification. Generally, arcCams use the .alpha property for their rotation. But keep in mind that arcCams CAN have .target and .lockedTarget (node or vec3), and by positioning THOSE in a circular pattern around the camera… the camera will also spin on its local axis.

ArcCams - pivotPoint is .target or .lockedTarget, right? Or… is it located at camera.position? I get confused. :slight_smile: https://www.babylonjs-playground.com/#HB4C01#108 (line 66)

You can replace line 66 with: anchor.rotation.y += .01; (looks similar)

really thanks but neither anchor.rotation nor camera.alpha is working i tried both

Sorry. Can you reproduce the problem… in a simple playground scene? (thx)

No errors at console? hmm. I wish I could be more help.

sure , by that time can you please look after my another question How to make A kind of rectillium/selector in babylon

You want to spin camera and/or cylinder… a small amount left/right… to “face” (aim-at/align-with) the clicked button, yes?

yes :slight_smile:

:smiley: you can also goto about us object , then rotate you will find another object , i donot want to rotate it . some thing like that

Another little test. I finally remembered what args are sent to an observer handler (2 objs, often labeled ‘d’ and ‘s’ - see line 36). The s object has a .target property… and that has a _node obj, and we can use that to animate camera target-to.

Camera position is ALSO being animated… using a kludge new position that is derived from the amount of change (diff) that the target changed. It’s all pretty annoying yet. I hope smarter people help, soon… or I hope Amit figures it out. :slight_smile:

I don’t have any VR gear here… or much of a clue about how to do these animations more-accurately. We sort-of need to project the verts of each button… outward toward the camera, and then… umm… then I have no idea what to do next. I’m not qualified. :open_mouth:

I detached the camera from scene… because IF user turns this camera MANUALLY, everything else screws-up. Perhaps later, we can re-attach and all will still be fine. I should have studied ‘transforms’ more when I was in grammar school.

Calling all forum helpers… MORE HELP WELCOMED!

So just to make sure I get your ask correctly:

When clicking it will rotate the panel a bit

Oh, maybe so. (thx)

I think maybe… hmm.

Can you imagine what a “column normal” would be? A line extending orthogonal to column-of-buttons, sort-of toward camera. Maybe user wants camera positioned ON the clicked column-normal… and cam aimed back towards column origin (at consistent radius distance).

Essentially, camera OR cylinder… animation-rotates til selected column… is perfectly LookAt camera, and camera.target == column origin (no camera beta change, maybe only alpha). But I could be wrong. One-column of rotation per animation run (unless click is in SAME column as last click).

BUT… that “one-column of rotation per animation run”… COULD happen 4 times in a single click (if newly-clicked button is within a column that is 4 columns left/right-of current column).

Wingy yammering with speculation. What’s new there?

Panorama-menu. Panoramenu. :slight_smile: I guess we wait for more info. Thx for comment, dk.

panel.node.rotation.y += 0.51; --> not working. it bring all object together near to each other.but cylinder does not rotate.

Interesting! Strange. If you can show us THAT… happening in a simple playground demo… that would be great. Perhaps panel.node is the wrong object to rotate, and should be anchor instead? (I’m just guessing/trying to think-up helpful things).

(line 66 proves that the cylinder CAN rotate around Y-axis. hmm. * Wingy beard scratch * )

Hi @Wingnut Really Thanks for help Why things were not working is
panel.position.z = -5;
I have changed it to
anchor.position.z = -5;
not it is taking axis as dezired.
I have also prepared an example so that it helps some one in need .


also anchor.rotation.y+=2.3; works only when after all the objects are added , that is why it works well in onClick but does not work after creating the panel.

1 Like