How can I apply two different rotations to the same Blender object? - blender

I'm trying to build an object with multiple gears. One of the gears is attached to a larger gear, so when the larger gear rotates the smaller gear moves too, around the center of the larger gear.
Simultaneously, the smaller gear is rotating as well - but its rotation is around its own center, independent of the larger gear.
So:
Larger gear rotates around its center
Smaller gear moves around the center of the larger gear with its rotation
Smaller gear is also rotating independently
I can get 1 and 2 by animating the larger gear's rotation and then grouping both gears, but I can't figure out how to get the smaller gear to rotate around its own axis as it's going around the larger gear.
Any ideas would be appreciated.

The key is parenting.
Create the first gear and get it rotating.
Create the second gear next to it and animate that one.
Select the second gear then shift select the first gear and press ⎈ CtrlP and select Object.
Now as the first gear rotates, the second will follow it's rotation while keeping it's own rotation.
If you want the outer gear to rotate the opposite way to the inner gear you can place an empty at the same location as the inner gear and use a copy rotation constraint and set invert to have it rotate the opposite way, then parent the outer gear to the empty.
Here's a sample file
(source: giantcowfilms.com)

Related

Blender 2.8: object pivot + pixel align + object part grouping (newbie)

I have started learning Blender 2.8 as of May-25. Almost 10 years ago, I was using 3dmax v7 but only as a hobby. I want to start doing 3ding again as hobby but got no money to have something that is up to date. So I chose Blender.
Now I have a few questions. I will surely have more questions later. I am still thinking in terms of 3dmax ways.
How do I recenter the object pivot if I accidentally displaced it with MB1 and doing Ctrl-Z is not a solution ?
How do I align vertices to the grid but only using the axis of my choice ? (ex: align on the X axis grid or any other axis of my choice)
how do I group object parts (vertices, faces, ...) as different groups and then working with the group of my choice ?
how can I maximize the view port with one single keys shortcut thus hiding every menus and then once I am done doing what I wanted to on that maxed view, revert back to whatever interface view I was using before ?
how to select anything using a region drawn by mouse movements (meaning selecting without using box or circle or shift, just mouse mouvements)?
Firstly blender 2.80 is under heavy development while making some major changes so can be of varying functionality for now. I would suggest you start learning with 2.79b until 2.80 is finished.
There are several options when it comes to choosing a pivot point, I think what you are referring to is setting the object origin.
There are several snapping options and ways to control transformations. You can limit movement to one axis by pressing it's key while transforming, eg GX will only move along the X axis, you can not move on one axis by adding ⇧ Shift - G⇧ ShiftX will move on Y and Z but not X. To align vertices to one axis is it common to scale to zero one the axis, eg SX0 will scale the verts on the x axis so they all align, in object mode you can do the same as long as you enable manipulate centre points. There are align options available in some addons, like align tools and mesh align plus.
Blender doesn't have vertex grouping and I don't know of any addons that add it. You can assign vertices to a vertex group and use that to select/deselect a collection of vertices.
There are two options to maximise the viewport - ⎈ Ctrl↑ Up arrow will maximize the viewport, the info bar at the top and headers for the view will remain in place or ⎇ AltF10 will make the view full screen also removing the info bar and headers. Also the window layouts are saved as screens which you can make and define to your liking, by saving these screens in your startup blend you can keep them available each time you use blender. The default screens include a 3D only layout.
For lasso select you can hold ⎈ Ctrl while pressing the non-select mouse button to draw an arbitrary region to select items within.

Blender how to round edges of face

I'm trying to make a round eye in my object by selecting a face, pressing e, dragging it into the face a little bit and I'm trying to make that eye round instead of square. How can I do this?
There is "To Sphere" AltShiftS available under Mesh->Transform. As the name suggests it adds a spherical influence, if the selected verts lay flat on a plane the result is circular.
Another option is an addon called LoopTools. Enable it and you have some extra options in the specials menu (W) which includes Circle, which will give a circular influence to the selected vertices.

Transform co-circular stadium view into a omnivision (planar) view

Imagine a stadium (e.g. football) with an omnivision (fisheye) camera on top, centered.
You'll get a picture, wich will give you an almost planar view of the field.
Now comes a second camera setup:
You have the same stadium, but with normal (no fisheye) cameras in the top, four corners, pointing on the field.
Now here comes the question:
Is there a transformation between these two camera setups?
I thought of a Hough transformation, to get a planar view of the field with the second camera setup. Am I heading into the right direction or do you have any other ideas to get a planar view?
Ok basically you can create the fisheye effect by just making multiple picuteres and transform them accordingly, stitching is the way to go http://en.wikipedia.org/wiki/Image_stitching
However with a fisheye ontop a football field you will not get a planar view of the field. A planar view you get if you move your camera up the z-Axis till infinity! So it's rather a zoom.
Am I right and you really want to create a minimap from a football field? Then the Hough Transformation is good to recognize the field on the pictures, and calculate the different camera positions, but you still need to transform the pixels in the pictures to become a planar view. To get sth. that looks like a picture.

How to warp an UIImage using Open GL or any other method...?

I am trying to develop an iOS app to make any given image (UIImage) warp on selected locations.
So for this task to be accomplished what should be the rightmost way going forward, for now i'm doing some research on doing this on OpenGL (frankly any heads up on the framework would be nice too).
So finally the requirement is to get the UIImage warp on some given locations. (If x, y coordinates are there)
If you're sufficiently familiar with (or willing to learn) OpenGL, then you could do this:
Create a flat, rectangular grid of points to be a mesh that will be displayed with OpenGL.
Apply the image to the mesh as a texture.
When distorting the image at a particular location, you can just decide which points on the mesh will be affected by the distortion, and move them.
You can push points out from the center, or in toward a center, or shift them all in the same direction. If the distortion affects a large area, then you change a lot of points (possibly changing those in the center by more than those near the edges of the affected area).
Not sure what you mean by 'warp'. Do you mean skew it in 3 dimensions? If so you can adjust the CGAffineTransform for the UIImageView you are displaying it in to get that effect.
If you mean some kind of image processing warp, and you are using iOS 5, you can use Core Image for that.

CCParallax for a moving background

I got a tiled map and I want to make lava lakes. I wish to have some kind of lava texture image on the background looping diagonally slowly. I could make it with four 960x640 images and move all of them diagonally etc. But when I do, a black/white line appears between each...
... and someone suggested me "CCParallax". I have never used it and am not sure if it really can achieve the effect I am seeking.
Also note that as the player moves on the map, the parallax will need to simulate that as well etc.
So my question is, what would you do for this effect? Four looping images or "CCParallax"?
CCParallaxNode is pretty limited because you can't specify endless parallax scrolling without modifying the class. It also doesn't quite fit your use case.
Using four 960x640 images is wasteful. Just to make some lakes underneath the background this is overkill and will negatively affect performance.
The solution depends a bit on how big the lakes are. For example, if these are just 1 or 3x3 tiles in size you could add a textured sprite underneath each lake. If on the other hand your tilemap consists mostly of a few narrow pathways while the rest is lava lakes, then you need a different approach.
You might want to try GL_REPEAT to repeat a single sprite's texture over a defined area. That allows you to use a relatively small texture, for example 64x64, that will be repeated over the rectangle you specified.
You can then modify the sprite's position each frame to scroll the texture. Every time the sprite has moved 64 pixels in horizontal or vertical direction, you subtract 64 pixels (sprite.contentSize.width) from the sprite's position to reset it back to its original state. That means the sprite will never move further than 64 pixels from its initial position in any direction but you still get smooth scrolling.