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ā€¦

https://www.babylonjs-playground.com/#HB4C01#107

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;
switch_page(button1,panel,1);
});

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:

yes
: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:
https://www.babylonjs-playground.com/#HB4C01#111

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).

https://www.babylonjs-playground.com/#HB4C01#112
(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