Is it possible to create a motion tween in as2 code - actionscript

Is it possible to make a motion tween with as2 code only ( not with timeline). If it is, then can you please tell me how to do it?

There's the Tween class:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/2/help.html?content=00000350.html
But I believe most ActionScript developers prefer to use the third party libraries TweenNano/TweenLite/TweenMax or Tweener, and that they still support AS2:
http://www.greensock.com/tweenmax/
http://code.google.com/p/tweener/

Related

Saving videos with meshcat?

What is the standard way of saving videos using MeshcatVisualizer? I know the following works for wrappers of PyPlotVisualizer:
visualizer.start_recording()
simulator.AdvanceTo(T)
ani = visualizer.get_recording_as_animation()
But the two relevant methods are not available for MeshcatVisualizer, and there don't seem to be any examples in the repo that create videos using it, and none of the methods that the class does have seemed like promising candidates. Failing that, is there another way of saving videos for 3D visualizations?
Meshcat has an animation tool: https://github.com/rdeits/meshcat-python/blob/master/animation_demo.ipynb , you can access MeshcatVisualizer's meshcat.Visualizer instance via MeshcatVisualizer.vis. However, MeshcatVisualizer doesn't have a function like MeshcatVisualizer.convert_to_video that supports this animation tool at the moment. Perhaps the easier route for now is screen recording.
I don't believe that meshcat offers it's own recording functionality, which means the recommended workflow would be to just use your favorite screen recorder software. I've forwarded this to a few meshcat experts in case they have something better to recommend.
Update: In addition to rdeits answer above, he had a few more details in email:
there's a built in animation API with recording support in
meshcat-python (see "Recording an Animation" in
https://github.com/rdeits/meshcat-python/blob/master/animation_demo.ipynb
), but AFAICT Drake's MeshcatVisualizer isn't hooked up to it. It
might not be that hard to do so--the basic idea is that you can use
at_frame to get a representation of a single frame of an animation
that behaves like a meshcat.Visualizer. You can call set_transform
on that frame, and rather than moving anything in the viewer it will
instead record that action into an animation track. Then you can send
the whole animation at once to the visualizer and let the browser side
handle replaying and recording it.

Augmented Reality, Move 3d model respective to device movement

I am working on augmented reality app. I have augmented a 3d model using open GL ES 2.0. Now, my problem is when I move device a 3d model should move according to device movement speed. Just like this app does : https://itunes.apple.com/us/app/augment/id506463171?l=en&ls=1&mt=8. I have used UIAccelerometer to achieve this. But, I am not able to do it.
Should I use UIAccelerometer to achieve it or any other framework?
It is complicated algorithm rather than just Accelerometer. You'd better use any third party frameworks, such as Vuforia, Metaio. That would save a lot of time.
Download and check a few samples apps. That is exactly what you want.
https://developer.vuforia.com/resources/sample-apps
You could use Unity3D to load your 3D model and export XCODE project. Or you could use open GL ES.
From your comment am I to understand that you want to have the model anchored at a real world location? If so, then the easiest way to do it is by giving your model a GPS location and reading the devices' GPS location. There is actually a lot of research going into the subject of positional tracking, but for now GPS is your best (and likely only) option without going into advanced positional tracking solutions.
Seeing as I can't add comments due to my account being too new. I'll also add a warning not to try to position the device using the accelerometer data. You'll get far too much error due to the double integration of acceleration to position (See Indoor Positioning System based on Gyroscope and Accelerometer).
I would definitely use Vuforia for this task.
Regarding your comment:
I am using Vuforia framework to augment 3d model in native iOS. It's okay. But, I want to
move 3d model when I move device. It is not provided in any sample code.
Well, it's not provided in any sample code, but that doesn't necessarily mean it's impossible or too difficult.
I would do it like this (working on Android, C++, but it must be very similar on iOS anyway):
locate your renderFrame function
simply do your translation before actual DrawElements:
QCARUtils::translatePoseMatrix(xMOV, yMOV, zMOV, &modelViewProjectionScaled.data[0]);
Where the data for the movement would be prepared by a function that reads them from the accelerometer as a time and acceleration...
What I actually find challenging is to find just the right calibration for a proper adjustment of the output from the sensor's API, which is a completely different and AR/Vuforia unrelated question. Here I guess you've got a huge advantage over Android devs regarding various devices...

Box2D in Objective-C

I am currently running Kobold 1.0.4 and cannot work out how to use Box2D using Objective-C, any help will be appreciated.
I have looked at the Box2d example project with kobold but it uses only c++ i need to do it in objective-c as i am not really confident playing with both.
Change extension of your source files from *.m to *.mm to be able to use c++ classes in them. It will allow you to create and manage box2d objects in your objective-c code
Box2D is written in C++ so one way or another there's no getting around it. Since Box2D's code does the heavy-lifting, the amount of C++ code needed to us it is quite small, you just need to get the boilerplate up for collision handlers and then the code you fill it with can be as objective-C as you want.
If you want something that helps get geometry into your app, PhysicsEditor is a good tool and they have a plist exporter and provide an objective-C class for loading the data. It takes care of a lot of boilerplate, and if you want to do collision geometry for anything interesting it's very helpful.

How to write a code to read .fla file?

I was wondering so long that how can people analyze the trait of each file extension (of course open it in notepad is not readable)
For example, I want to write a program that can read everything from .fla file like timeline, movie clips, position of each MCs or all the motion tween values. And get the image embeded in it. (I'm planning to use flash as IDE for another project.)
(The reason that I tried to read proprietary format is I want to utilize their awesome editor. What I actually want to do is, I want to make an iOS game with cocos2d. There is a code to move things around in cocos2d but there is no decent editor. So I'd like to use Flash as an editor, then convert the motion to objective-C cocos2D code by reading the .fla file.)
If you would like to be able to import timeline animation from flash into cocos2d, this tool might help. More information in this thread.
The grapefrukt-exporter might also help as it can export keyframe data, and various other formats for animation.
Instead of creating the tool yourself, it might be much easier (and time saving) to use one of these and integrate it into your workflow :)
Finally, if none of the above works, how about just exporting the flash animation as an animated GIF or a movie file?
Im assuming you want to write a decompiler, this is possible and there are several available on the internet, price varies.
It is not possible for flash to achieve this, Most programs, software are built on a native language such as C, Native meaning it can independly run in its own with out initially setting up an invironment to support it.
Flash is not independent enough to be available to have this much power.
Try looking at c++ or C# as this would be possible, also these languages are a lot more powerful.

Chess move validation library for ActionScript 3

Do you know any chess move validation library for ActionScript 3 ?
I have searched in google but I can not find anything.
Please tell me if you know.
If there isn't any library, I think that I have to port from Java to AS3.
I think I'd just write it because it is going to end up very tightly bound to your game/position representation.
Think about it: ust legal moves, or move validation in game context (50-move rule, 3-time repeated position, en-passant, promoted pieces, castling availability...?).
You might even have to pass the entire move history for the game.
It is not that much work if you think about it.
http://code.google.com/p/osas3cf/updates/list
That one has code included for a chess move validator. Check it out

Resources