3D Physics / Transforms animation tool - animation

I'm searching a 3D physics / transforms animation editor. It should be able to import 3D meshes from OBJ or FBX, then it should be able to animate transforms. I need such a tool for my 3D Games, where many dynamic and inorganic elements appear, like: doors, traps, robots, lifts, and so on. WHere I can find such a tool? Thanks in advance for reply.

Try Blender. It's an open-source software for 3d modelling, texturing, animation, etc.
Blender supports physical simulations using well-known Bullet physics engine:
http://www.blender.org/development/release-logs/blender-240/bullet-physics/

Related

Convert THREE.js scene to CANNON.js world

I have a basic THREE.js scene, created in Blender, including cubes and rotated planes. Is there any way that I can automatically convert this THREE.js scene into a CANNON.js world ?
Thanks
Looking at the Three.js Blender exporter, it looks like it only exports mesh data, no information about mathematical shapes (boxes, planes, spheres etc) that Cannon.js needs to work. You could try to import your meshes directly into Cannon.js, using its Trimesh class, but this would sadly only work for collisions against spheres and planes.
What you need to feed Cannon.js is mathematical geometry data, telling it which of your triangles in your mesh that represent a box (or plane) and where its center of mass is.
A common (manual) workflow for creating 3D WebGL physics, is importing the 3D models into a WebGL-enabled game engine (like Unity, Goo Create or PlayCanvas). In the game engine you can add collider shapes to your models (boxes, planes, spheres, etc), so the physics engine can work efficiently. You can from there preview your physics simulation and export a complete WebGL experience.
Going to post another answer since there are a few new options to consider here...
I wrote a simple mesh2shape(...) helper that can convert (one object at a time) from THREE.Mesh to CANNON.Shape objects. It doesn't support certain features, such as heightmaps/terrain.
Example:
var shape = mesh2shape(object3D, {type: mesh2shape.Type.BOX})
There is a (experimental!) BLENDER_physics extension for the glTF format to include physics data with a model. You could add physics data in Blender, export to glTF, and then modify THREE.GLTFLoader to pass along the physics data to your application, helping you construct CANNON.js objects.

Particle system export from Maya to three.js

I am evaluating my options regarding exporting particle systems from Maya 2012 to Three.js.
Does anyone know the best way of going about this?
It doesn't appear that any existing exporters have particle system export capability, so I have come up with a couple of alternative approaches:
Convert the particle system to an animated mesh, export using the Black Tower exporter, and display as an animated PointCloud in threejs. Is this even possible in Maya? How would I go about doing that conversion?
Write a custom Maya export script that exports the attributes of a particle system, then write an importer to create a Shader Particle Engine from those attributes.
The first option has the advantage that any complex particle-scene interactions (e.g. particles bouncing off walls, gravity etc) would be included in the animations. The second option would have to have these programmed into the js side, but is likely to be more performant.
Is there a better approach that I haven't thought of? Or existing libraries I haven't been able to find?

Artificial intelligence functionality in three.js

Does Three.JS have a function or capability of AI( Artificial intelligence )? Specifically let's say a FPS game. I want enemies to look for me and try to kill me, is it possible in three.js? Do they have a functionality or a system of such?
Webgl
create buffer
bind buffer
allocate data
set up state
issue draw call
run GLSL shaders
three.js
create a 3d context using WebGL
create 3 dimensional objects
create a scene graph
create primitives like spheres, cubes, toruses
move objects around, rotate them scale them
test for intersections between rays, triangles, planes, spheres, etc.
create 'materials' (rather than shaders)
javascript
write algorithms
I want enemies to look for me and try to kill me
Yes, three.js is capable of doing this, you just have to write an algorithm using three's classes. Your enemies would be 3d objects, casting rays, intersecting with other objects, etc.
You would be building a game engine, and you could use three.js as your rendering framework within that engine. Rendering is just one part of it. Think of a 2d shooter, you could make it using a 2d context, but you could also enhance it and make it 2.5d, by working with a 3d context. Everything else can stay the same.
any webgl engine that might have it ? or is it just not a webgl thing
Unity probably has everything you can possibly think of. Unity is capable of outputting WebGL, so it could be considered a 'webgl engine'.
Bablyon.js is more engine like.
Three Js is the best and most powerfull WebGL 3d engine that has no equal on the market , and its missing out on such an ability
Three.js isn't exactly a 3d engine. Wikipedia says:
Three.js is a lightweight cross-browser JavaScript library/API used to
create and display animated 3D computer graphics on a Web browser.
Three.js uses WebGL.
so if i need to just draw a car, or a spinning logo, i don't need them to come looking for me, or try to shoot me. I just need them to stay in one place, and rotate.
For a graphics demo you don't even need this - with a few draw instructions, you could render a full screen quad with a very elaborate pixel shader. Three gives you a ton of options, especially if you consider all the featured examples.
It works both ways, while you can expand three.js anyway you want, you can strip it down for just a very specific purpose.
If you need to build an app that needs to do image processing, and feature no '3d' graphics, you could still leverage webgl with three.js.
You don't need any vector, matrix, ray , geometry classes.
If you don't have vector3, you probably cant keep planeGeometry, but you would use bufferGeometry, and manually construct a plane. No transformations need to happen, so no need for matrix classes. You'd use shaders, and textures, and perhaps something like the EffectsComposer.
I’m afraid not. Three.js is just a engine for displaying 3d content.
Using it to create games only is one possibility. However few websites raise with pre-coded stuff like AI (among other things) to attract game creators, but using them is more restrictive than writing the exact code you need
Three.js itself doesn't however https://mugen87.github.io/yuka/ is a great AI engine that can work in collaboration with three to create AI.
They do a line if sight and a shooting game logic, as well as car logic which I've been playing around with recently, a React Three Fiber example here: https://codesandbox.io/s/loving-tdd-u1fs9o

OpenGL rolling ball

I'm writing an OpenGL ES 1.0 Android 2D game. There I want to create a rolling ball but I have no idea how to do this. Of course I can load a ball texture and move it along the x or y axis but the rolling effect is not there. How can I create such an effect? The game is in bird perspective so you are looking from above to the field.
The proper way to do this sort of animation with texture coordinates mapped to geometry is to use an authoring tool, such as Maya, 3DSMax or Blender. Blender is free and fantastic. I highly recommend it. You will also need some middleware to import the geometry, textures and animations created in Blender. For this, look into the PowerVR SDK or Ogre3D or Valve tools.

THREE.js + Mesh Modifiers

Coming from ActionScript + Papervision I am familiar with "AS3DMod" a library that modifies 3D meshes to bend, twist,etc. Now I am working with THREE.js and found this:"#MOD3 As3dMod 3D Modifier Library port for Javascript and Three.js, Pre3d and J3D and Copperlicht" but the code is outmoded for any remotely current versions of THREE.js (and also is written for canvas rendering, NOT webGL). The creator has not been able to update. Does anyone know of any similar 3D libs that can "bend ,twist, bloat" 3D meshes in webGL? I am not sufficiently skilled to update this myself.
Thanks for any suggestions.
Not that I know of, but depending on what modifiers you are utilize, it may not be too difficult to write a modifier yourself. Typically you can reuse the logic in js for Canvas renderer, and as for WebGLRenderer, you can implement it in the Vertex shaders.

Resources