Annotate 3d model in Android

Started by dhananjay, January 02, 2019, 02:29:31 PM

Previous topic - Next topic

dhananjay

Hi
We would like to display and annotate a user given 3d model file in Android based mobile device. Can you please help us with it. We have found some resources online that are able to display a 3d model, but annotating is not supported in them.

EgonOlsen

I'm not sure what you mean by 'annotating' in this context?

dhananjay

We are able to render a 3d model (from STL, OBJ or DAE file) in an Android app using this engine ( https://github.com/andresoviedo/android-3D-model-viewer/ ). Now we need help to show a text at the particular X, Y, Z position on it.

EgonOlsen

Well, this is a jPCT related forum, your solution doesn't use it. However, the basic idea is to take point in 3D space on which you want to "attach" the annotation to, project that into 2D screen space and then somehow blit the annotation as text on that position. Either that way, or you could "attach" another object at that point in 3D, make it inherit the actual object's transformations but render it as a bill boarded quad with the annotation's text rendered onto it. That has two drawbacks: It's much more complicated and it scales with the object which might render the text unreadable. Anyway, I've no idea on how to implement any of this in the context of your current solution.

dhananjay


EgonOlsen

I don't know, because I don't know what your current solution can do "out of the box" or what your actual requirements are. jPCT provides means to do the projection 3d->2d as well as blitting, so that part is rather simple (a few lines of code should suffice). Another question is how the user is supposed to attach the annotation? By tapping on the object? By some other means? If it's the former, jPCT provides means to find a point on an object that corresponds to a screen coordinate as well, so that's rather simple to solve as well.
What jPCT doesn't provide are loaders for STL or DAE but you should be able to port yours over to it. Again, it depends on your actual requirements, so I can't tell if one way is "easier" than the other...