examples/js/controls/DeviceOrientationControls.js has this line
`this.object.rotation.reorder( "YXZ" );'
In a 360 video player, I am recording camera.rotation angles(x->pitch, y->yaw, z->roll), without this line the values of them seem weird (not just the values are swapped like if the x->roll and z->pitch), when I apply this reorder(in MouseControls and VRControls), they become more sensible.
So what does this line really do? and why other controllers does not have it? Why it is not just an issue of swapping?
Related
Blender is a great way to put together a presentation, and I often manually navigate through the blender file to do a presentation. But for a more formal presentation, it would be good to move through it in a specific way and not have to worry about the precision of my manual navigation. Prezi already works like this, you tell it what you want to look at on each "slide", then it seamlessly transitions through the space.
I haven't seen a lot on this, so figured I would start a thread here to talk about it.
One way to do this is by moving the camera to certain spots in the scene. It is easy to then "jump" to different "slides", using the up and down arrow key which jumps to that spot on the timeline. If you are viewing the camera, it will then switch 'slides'. To get a transition, you could play the timeline, but you would need it to STOP on the next keyframe so you have time to talk about that 'slide' before moving on.
Perhaps there is an easy way to do this, but for now, the following python code is what I came up with. It just stops the animation playback if a camera keyframe is encountered. This seems to work, but I see some extra events in there so I worry it is going to bog something down.
import bpy
# Build a set of camera keyframe frames numbers
camera_obj = bpy.context.scene.camera
camera_keyframes = set()
for fcurve in camera_obj.animation_data.action.fcurves:
if fcurve.data_path.startswith("location") or fcurve.data_path.startswith("rotation_euler"):
for keyframe in fcurve.keyframe_points:
camera_keyframes.add(round(keyframe.co.x))
print("Set of Keyframe frames= " + str(camera_keyframes))
# Define the function to stop at camera keyframes
def stop_at_camera_keyframes(scene):
print("Current Frame= " + str(scene.frame_current))
if scene.frame_current in camera_keyframes:
print("At a keyframe in set, stopping.")
bpy.ops.screen.animation_cancel(restore_frame=False)
# Register the function as a handler for the "frame_change" event
bpy.app.handlers.frame_change_pre.append(stop_at_camera_keyframes)
print("Registered Function")
I'm working on an application in which Users can draw lines (with or without arrowheads). Similar to PowerPoint or SnagIt, but on a 3D plane."
Basically I would like to be able to create some line types like in the attached draft:
I've seen the fat lines demo (https://threejs.org/examples/#webgl_lines_fat). But lines don't seem to change width when zooming, and they don't have perspective.
There is also this 3rd party library THREE.MeshLine (https://github.com/spite/THREE.MeshLine) which has some nice features, even dashed lines animation, but before experimenting with it I would like to see what ThreeJS can do by itself.
1) Using ThreeJS Line is there a way to get:
Size and perspective change depending on camera distance/zoom or angle.
Dotted lines (Maybe extending DashedLineMaterial?).
2) Maybe there is a library other than THREE.MeshLine that does what I need?
MeshLine is definitely what you want. Three.js's line implementations are all pixel based and don't really fit your needs. MeshLine is well written and performant, I use it myself for a similar purpose - it'll serve you well.
This answer provides a nice way to make smooth animations in SciLab. I now have to write a simulation of a body attached to two strings (and therefore its movement regarding some additional forces).
The code in the link works well to render movement of a single point and, unfortunately, I didn't manage to make an animation of a point + two lines using this method. If someone is curious, I tried this code to do it:
frametime=(tk-t0)/Nt//defining the waitnig time
plot(Y(1,1),Y(2,1),"o")//plotting the point
plot([0;Y(1,1)],[0;Y(2,1)],style=1)
plot([D;Y(1,1)],[0;Y(2,1)],style=1)//plotting the two initial lines
h1_compound = gce();
h_point=h1_compound.children
h_point.mark_size = 20;
h_point.mark_background = 2;
h_line1=h_compound.children
h_line2=h_compound.children
//h_axes = gca();
//h_axes.data_bounds = [0,-1;10,1];
realtimeinit(frametime);
for i=1:Nt//my vectors have Nt points
realtime(i);//wait "frametime" seconds before drawing the new position
h_point.data=[Y(1,i),Y(2,i)];
h_line1.data=[[0;Y(1,i)],[0;Y(2,i)]]
h_line2.data=[[D;Y(1,i)],[0;Y(2,i)]]
end
The question is: is there any way to make an animation of three shapes without making axes blink (as it is with the window refreshment) or other wierd stuff?
Since you didn't create a MCVE I can't reproduce your exact problem. But you may try to add drawlater(); before, and drawnow(); after your data modification to see if it does help with blinking or not.
Or you may get much better looking result by saving your plots in every round with xs2gif and assemble the animation with another gifmaker progam (there are free online sites to do this, however with some limitations). If you need to present your result, you should do this step anyway.
In our project we found strange swiffy behavior and we can`t find why it happenes.
TestCase1
TestCase2
Banner A (goes first in first case, second in case two), must have on 3rd slide border around photo that appears in slide.
And it works as expected if he goes last like in case2. But dose not if he goes first like in case1.
Why could it be and how it could be fixed?
I'm drawing a handful of lines (THREE.Line). Under some conditions, the line suddenly disappears from the screen. This happens frequently when one endpoint is far outside the camera's field of view, but the other one is definitely within the field of view. This also happens when the line crosses the camera's field of view, but both endpoints are far outside it.
I can temporarily fix it by setting frustumCulled to false for each line, but this isn't optimal since I might have thousands of lines in the scene.
Is this working as expected?
BTW, I'm using r68. I haven't had time to refactor my app to work with r69. I'm using the WebGLRenderer.
I needed avoiding lines to dissapear too.
Following Justin idea of frustumCulled I had to do
line.frustumCulled = false;
I thought it was
line.geometry.frustumCulled = false;
but I was wrong, you've to apply it on the line not on its geometry.
This works for me on version 0.70