is there a way to rotate an actor's pitch past 90 degrees in unreal engine 4 - unreal-blueprint

I a working on a game and for some reason I can't get my component to rotate past 90 degrees pitch. I've distilled it down to EventTick->AddRelativeRotation(0, 5, 0) but when it hits the 90 degrees pitch mark it simply jitters back and fourth. I've read many pages on this topic and I simply cannot find an answer. If anyone can help it would be greatly appreciated.

This is known bug since 2014 but is not fixed yet. One way to get around this is make a rotator before then assign this rotator to target object.
Break old rotation into 3 float values
Make a new rotator adding the offset value from the old rotation (y=5 in your case)
Assign rotation to desired object

Rotations using only three axes can be problematic. Rotations are more stable and reliable when using quaternions. The jittering you mention sounds a lot like something that would be fixed by using quaternion rotation instead.
It can be a bit confusing but there's plenty of documentation about this on the internet now that you have a term to search for.
Then, have a look at this UE forum post: Rotate a mesh around its center using quaternion It contains a link to a video showing how to do rotations using quaternions in UE, and some Blueprint that might help as well.

Related

setting new Y axis in as3

Ok lets say i have image and i want to rotate it along Y axis. Problem is i need to move my Y axis so rotation would be proper. I do my work in pure as3 code so this trick needs to be done in pure as3 code, so no flash drawing tools available :( .
here some images that may help you
LATEST EDIT: problem is solved with ez then i found that as3 actually also have 4x4 matrices that called Matrix3D in documentation , so now it possible to do all 3d rotations.
Answering your question without a code example is very hard. As I can see, your local position of the figure is somewhat different from what you intend it to be to rotate as desired.
Generally spoken, there are two potential issues to solve:
You may adjust your image's x and y values so that the image is always drawn as desired. So you need to add/remove an offsetX and offsetY variable to all your drawings of your image to fine-adjust it's local position.
If you use a rotation function with a matrix you should beware of the correct sequence. Rotation applies differently either when you apply translation before or after it.
Hope this may help you. If you want a more specific answer, you need to provide some code exampple.

Rotating a rectangular solid about the y axis without image distortion using canvas renderer (three.js)

I've spent several hours trying to work around this issue... when rendering really simple shape (ie. a cube with very low complexity) and using a texture map feature of Three.js, when you rotate the cube the image seems to be distorted while in rotation, and then you can see a line which runs across the surface of the cube which appears as distortion.
http://screencast.com/t/VpSPRsr1Jkss
I understand that is a limitation of canvas rendering - but it seems like this is is a really simple thing to do - rotate a cube that has an image on one face without the distortion.
Is there another canvas library or approach i can take? I was really looking forward to using Three.js for animating some logos and other elemnets - but we can't have distortion like that in a logo or a customer facing landing page.
Thanks for reading, I'm open to suggestions here.
I don't accept increasing the complexity of the face as a solution because that just distributes the distortion through out the face. I really just want to render the image to a flat surface and be able to rotate that object.
The distortion you see is because only two triangles make that plane.
A quick fix is to have more detailed plane.
If you are using PlaneGeometry, increase the number of segments.
If you are using CubeGeometry, increase the number of segments on the plane you need (2 out of 3).
It will take a bit of fiddling to find the best balance between a decent look and optimal performance (as more segments will require more computing). Hopefully for simple scene you'll get away with no major delays.

Box2D Flash moving one body to another

I am writing a children learning game, whereby you move letter blocks around in physics and snap them in to the correct place.
I have 3 static sensors which work great and when another box touches them I can run code on that instance, but for the life of me I cannot get the moving box to take position of the sensor.
3 days I have tried different ways, with set transform.
All I need to do is move a dynamic box that hits my sensor in to the exact same position as the sensor.
I thought it would be easy but its giving me a real headache...
I had similar problems and I found this page with a lot of good tutorials, when I learned box2d... Maybe lesson 2.25 and 2.26 point out what you desiring for.
good luck

box2d: How do I rotate an object on specified amount of degrees smoothly

I wonder if box2d has some options for doing that?
I am trying to apply angular velocity atm, but don't know where to stop rotating :(...
So object which needed to rotate to 90 degrees, can't stop rotating....
Well I did it adding small angular velocity and comparing to current angle of the object... Not sure why I've asked the question. Everything worked well!

Converting Pixels to Bezier Curves in Actionscript 3

Ok, so I'll try to be as descriptive as possible.
I'm working on a project for a client that requires a jibjab-style masking feature of an uploaded image.
I would like to be able to generate a database-storable object that contains anchor/control positions of a bezier shape, so I can pull it out later and re-mask the object. This all is pretty easy to do, except for one catch : I need to create the bezier object from a user-drawn outline.
So far, here's how I imagine the process going:
on mouse down, create a new sprite, beginFill, and moveTo mouse position.
on mouse move, lineTo an XY coordinate.
on mouse up, endFill.
This all works just great. I could just store the info here, but I would be looking at a GIGANTIC object full of tons of pretty useless x/y coordinates, and no way to really make fine-tuning changes outside of putting handles on every pixel. (I may as well give the end user a pencil tool...)
Here's what I'm thinking as far as bezier curve calculation goes :
1: Figure out when I need to start a new curve, and track the xy of the pixel on this interval. I'm imagining this being just a pixel count, maybe just increment a count variable per mouse move and make a new one every x pixels. The issue here is some curves would be inaccurate, and others unnecessary, but I really just need a general area, not an exact representation, so it could work. I'd be happier with something a little smarter though.
2: take each new x/y, store it as an anchor, and figure out where a control would go to make the line curve between this and the last anchor. this is where I get really hung up. I'm sure someone has done this in flash, but no amount of googling can seem to help me out with the way to get this done. I've done a lot of sketching and what little math I can wrap my brain around, but can't seem to figure out a way of converting pixels to beziers.
Is this possible? All I really need is something that will get close to the same shape. I'm thinking about maybe only placing anchors when the angle of the next pixel is beyond 180 degrees in relation to the current line or something, and just grabbing the edge of the arc between these changes, but no matter how hard I try, I can't seem to figure out how to get this working!
Thanks for your help, I'll be sure to post my progress here as I go, I think this could be really useful in many applications, as long as it's actually feasible...
Jesse
It sounds like a lot of work to turn pixels into Bezier curves. You could try using something like the Linear least squares algorithm. http://en.wikipedia.org/wiki/Linear_least_squares
A different tact, could you have your users draw vector graphics instead? That way you can just store the shapes in the database.
Another cool method of converting raster to vector would be something like this iterative program: http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
Good luck
In my answer to this question I discuss using autotrace to convert bitmaps to beziers. I recommend passing your user drawing through this program on the server. Autotrace does a fantastic job of tracing and simplifying so there is no need to try and reinvent the wheel here.
Thanks for the answers, although I guess I probably should be more specific about the application, I'm really only needing an outline for a mask, so converting images to vectors or polygons, despite how cool that is, doesn't really fix my issue. The linear least squares algorithm is mega cool, I think this might be closer to what I'm looking for.
I have a basic workaround going right now, I'm just counting mouse moves, then every X (playing with it to get most desirable curve) moves, I grab the xy position. then, I take every other stored xy, and turn it into an anchor, the remaining xys are turned into controls. This is producing somewhat desirable results, but has some minor issues, in that the speed at which the mask is drawn effects the number of handles, and it's really just getting a general area, not a precise fit.
Interestingly, users seem to draw slower for more precise shapes, so this solution works a lot better than I had imagined, but it's not as nice as it could be. This will work for the client, so although there's no reason to pursue it further, I like learning new things, and will spend some off the clock time looking into linear least equations and seeing if I can drum up a class that will do these computations for me. If anyone runs across some AS3 code for this type of thing, or would like some of mine, let me know, this is an interesting puzzle.