How can i save a 3D Object in Google Tango? - google-project-tango

Is it possible to save a 3D object in Google Tango and then detect it?
example: i want to save my car in it. Can Google Tango now detect every car of the same model as "my car". I just want to know if it is possible already with Google Tango , or do i have to write an application for it?

I think there isn't yet any Tango application available to the public that can capture a 3D object like a car, save it, and then recognize even that same individual car again later.
The Constructor app is I think the most sophisticated 3D model capture app publicly available. It only captures and saves 3D scenes. It can't separate objects like a car from the rest of the scene, like the road it's parked on or the wall behind it etc. You could open the saved scene in a separate application, like a 3D studio, and edit the scene like any other, then continue passing the model to other (non-Tango) applications. But that's a human/tool workflow.
The rest of the app you're describing would have to later recognize other 3D objects in captured 3D scenes by matching at least some distinctive features of the saved earlier capture. I don't know of any app that does that. And I'm not sure that the Tango hardware currently available to the public is fast enough to do that, nor the Google webservices that support more sophisticated intelligence about what Tango captures. And recognizing the same model car, but with different colors/options, dirty/scraped, etc is a really tall order for Tango at this time.
But it does sound like a killer app. Somebody push the envelope and make this happen!

Related

Monogame Extended Tiled

I'm making an isometric city builder using Monogame Extended and Tiled. I've got everything set-up and now i need to somehow access the specific tiles so i can change them at runtime as the user clicks on a tile to build an object. The problem is, i can't seem to find a "map.GetLayer("Layername").GetTile(x,y) or .SetTile(x,y) function or something similar.
Now what i can do is edit the xml(.tmx) file which has a matrix in it that represents the map and it's drawn tiles. The problem with this is that i need to build the map in the content pipeline again after editing for the changes to be displayed. I can't really build at runtime or can i?
Thanks in advance!
Something like this will get you part way there.
var tileLayer = map.GetLayer<TiledMapTileLayer>("layername");
TiledMapTile tile;
if(tileLayer.TryGetTile(x, y, out tile))
{
// do something with tile
}
However, there's only a limited amount of things you can actually do with the tile once you've got it from the map.
There's no such thing as a SetTile method because changing tile data at runtime is not currently supported. This is a limitation of the renderer, which has been optimized for rendering very large maps by building static geometry that can't be changed once it's loaded into the graphics card.
There has been some discussion about building another renderer that would handle dynamic map changes but at this stage nothing like that has been implemented in the library. You could always have a go at implementing a simple renderer yourself, a really basic one is not as hard as you might think.
An alternative approach to dealing with this kind of problem might be to pre-process the map data before giving it to the renderer. The idea would be to effectively separate the layers of the map that are static from those that are dynamic and render the dynamic tiles as normal sprites. Just a thought, I'm not sure about the details of how this might work.
I plan to eventually revisit the Tiled API in the next major version of MonoGame.Extended. Don't hold your breath, these things can take a lot of time, but I am paying attention to the feedback and kinds of problems people are experiencing with the existing API.
Since the map data is stored in a XML (or csv) file which runs through the Content Pipeline you can not change it at runtime.
Anyways, in a city builder you usually do not change existing tiles but you place object on top of existing tiles.

Tracking motion of object (by itself or by colour)

Is it possible to use the Google Tango Java API to track an object by itself (say, in the captured video feed I tap on the object and then the device tracks it continuously) or track an object by color (e.g. If I have a black sphere against a white background)
Unfortunately, the Tango API seems designed only to track the observer (i.e. the Tango tablet/phone), at present. If you'd like to track other objects, I recommend using it with a library like OpenCV:
See:
http://opencv.org/platforms/android.html
http://docs.opencv.org/2.4/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html
You'll need some way of detecting or selecting an object, and then some way of tracking it:
http://docs.opencv.org/3.2.0/d5/d54/group__objdetect.html
http://docs.opencv.org/3.2.0/d9/df8/group__tracking.html

How to use CRUD with Interactive 3d model? - Three.js

I am new to learn Three.js and I am not sure it's exactly suit for my needs!
I am creating web application using PHP to keep car accident details.
I was wondering if it's possible to have interactive 3d car object and I can mark the damage on the car with mouse click and post to server.(Create,Read,Update,Delete).
So when ever I open the client details I can see the damages that already mark on the car.
Could someone point me the right direction.
How can I achieve this?
You can have car model and you can write some javascript code to change this car model by mouse clicking. Problem is that you have to learn a lot about Three.js, 3d graphic and javascript. So the right direction is to start learning those 3 things. Three.js is not a 3d modeling tool so if you want to create car models in the browser you will have to write your own 3d modeling code. When you will have this Read, Update and Delete will just work. You will only have to add some code to write changes made in browser to your server.

How to render and retrieve image data on Google Project Tango?

I'd like to render the live image data on a GL surface (as shown in various Project Tango samples), and at the same time record (encode) it via a MediaCodec.
(On an Android Lollipop device, I've accomplished that using the camera2 interface and multiple surface targets, which works fine, but thus far Tango is pre-Lollipop...)
From other answers, it appears that you have to use the C API to access the image data.
The C API provides two camera frame functions -- TangoService_connectTextureId() and TangoService_connectOnFrameAvailable(). However, the documentation states "Use either TangoService_connectTextureId() or TangoService_connectOnFrameAvailable() but not both."
Why not both?
How do I best render and retrieve the image data?
The Pythagoras release now allows for simultaneous use of color and color texture callbacks now. That said, you want to use the connectOnFrameAvailable if you want to process the image, you'd end up doing extra unnecessary work if you try and peel it out of the texture.

Separated GUI and game logic class hierarchy?

Im developing a game on Java, and wanted to keep my code separated in packages for the hud/gui and the game logic so that code can be reused in some other project, and where objects to be drawn call methods from another class or classes (maybe a "rendering context" like a group of classes just made for the drawing or something like that), the problem is that i can't find the best way to achieve this, because I've researched the web (also this forum) and the design patterns but despite some looked interesting (like Model-View-Controller), I couldn't find something that suits me, neither the common approach to solve this problem.
I've been told to make the objects to implement some drawable kind interface, and in another class called by this objects, some object which implements drawable and inherits from canvas, for example, so that if i would want later to change the objects drawing or displaying methods for another one better, for example from awt to swing, to be able just rewritting those classes and dont need to worry about my objects code,
any help would be greatly appreciated, thanks in advance!
What I do is typically along the lines of:
Create your game objects completely independent of all things visual. I'm going to use chess as an example. Each chess piece inherits a "GamePiece" interface and knows it's valid moves, what "color" it is (not visual color, but what "side" it's on), etc. But these pieces do not have any code related to drawing themselves. None. Basically pretend like you're playing a game inside the computer and never need to draw it. Design your whole game this way. You'd need a GameDirector that manages the various pieces, the GameBoard, and abstract Players. But still, no visual representation. There's a lot of leeway in exactly how you design your class hierarchy but leave the visuals out of it.
You communicate state changes by raising events, this is key. So when a player moves, an event is raised. When the GameDirector detects checkmate, an event is raised, etc.
Then you have a GameRender class that contains a GameDirector. It listens for these events and updates the visual scene accordingly (whether it's a simple 2D thing or complex 3D animation). This class can optionally have sub-components that are responsible for rendering sub-components of the game but that's not strictly necessary.

Resources