Author Topic: Annotate 3d model in Android  (Read 2302 times)

Offline dhananjay

  • byte
  • *
  • Posts: 3
    • View Profile
Annotate 3d model in Android
« on: January 02, 2019, 02:29:31 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Annotate 3d model in Android
« Reply #1 on: January 02, 2019, 04:25:02 pm »
I'm not sure what you mean by 'annotating' in this context?

Offline dhananjay

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Annotate 3d model in Android
« Reply #2 on: January 04, 2019, 11:18:12 am »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Annotate 3d model in Android
« Reply #3 on: January 04, 2019, 11:49:24 am »
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.

Offline dhananjay

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Annotate 3d model in Android
« Reply #4 on: January 04, 2019, 01:30:29 pm »
Is doing this with JPCT easier?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Annotate 3d model in Android
« Reply #5 on: January 04, 2019, 02:29:14 pm »
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...