x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Rotate a mesh around it's center using quaternion

I would like your help if possible as i don't know a lot of quaternion me myself.

so i have a cylinder and i want to rotate around the up vector as its axis of rotation when i press up or down arrows or swipe on touch.and i want to rotate it around the right vector when i swipe left or right, or pressing left and right keys on keyboard.

My current setup is this

https://imgur.com/llYnc9P

and this is the cylinder i want to rotate.

https://imgur.com/Od0Slq1

So basically, i want when i press the up or down keys (or in case of mobile to swipe up or down) is to rotate around the green arrow and when pressing left and right i want to rotate around the red arrow.

I use quaternion bleuprint plugin found here https://www.unrealengine.com/marketplace/blueprint-quaternion-library

you can check the photos of the plugin for all of the available nodes.

i would appreciate any help.

Many Thanks

Product Version: UE 4.21
Tags:
more ▼

asked Mar 04 '19 at 01:34 PM in Blueprint Scripting

avatar image

IronSuit
8 3 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

i was able to solve the problems using those nodes.

Rotating the circle around it's axis left and right

This was used with quaternion plugin to find the quat at the y axis and to rotate the object around it

capture1.png (216.8 kB)
capture.png (149.6 kB)
more ▼

answered Mar 05 '19 at 08:45 PM

avatar image

IronSuit
8 3 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This tutorial will show you how to use quaternions for rotations.

https://youtu.be/KqbqZ3IY1II

Haven't bought that quaternion plugin so I can't say for sure what to use from there but the nodes should largely be similar. Looking up in the FQuat API there is a C++ function "Make From Euler" this is probably what you will want to use as a blueprint node if the plugin has make that accessible to you.

https://api.unrealengine.com/INT/API/Runtime/Core/Math/FQuat/MakeFromEuler/index.html

more ▼

answered Mar 04 '19 at 03:09 PM

avatar image

Nebula Games Inc
5.4k 28 9 14

avatar image IronSuit Mar 04 '19 at 08:43 PM

Please check the gif so you know what's my problem

https://gfycat.com/SlimyPerfectBluebreastedkookaburra

my current blueprint setup is alt text

i'm able to rotate around the up vector as my axis of rotation for left and right panning.

but for up and down panning weird issue happens. i think because of the Euler gimbals lock.

capture.png (329.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question