Closed GoogleCodeExporter closed 9 years ago
ok so you have some bitmap objects (the raster data) and you want to create a
box around the user with this bitmaps as textures? check the GLFactory there is
some example code how to create textured shapes.
Original comment by simon.heinen
on 5 Oct 2011 at 8:35
Thanks,
so I was able to combine the Vec adding from the mesh with the Textured2dShape.
My only problem now is, that with the following code produces a triangle, not a
rectangle:
Textured2dShape s = new Textured2dShape(IO.loadBitmapFromId(myTargetActivity,
R.drawable.dummy), "imgName");
Vec start = new
Vec( s.myPosition.x-(s.getTextureWidth()/2),s.myPosition.y-(s.getTextureWidth()/
2), 0);
s.add(start.copy()); // 1.
start.x += s.getTextureHeight();
s.add(start.copy()); // 2.
start.y += s.getTextureWidth();
s.add(start.copy()); // 3.
start.x -= s.getTextureHeight();
s.add(start.copy()); // 4.
Do I have to close the "path" somehow?
Second question is: how can I ensure the right position of the image in the
virtual coordinate system? Is there a wax to transform from geo-coordinates to
virtual coords?
kind regards!
Original comment by raphael....@gmail.com
on 6 Oct 2011 at 8:44
When you take a look at the GLFactory (
http://code.google.com/p/droidar/source/browse/trunk/droidar/DroidAR/src/gl/GLFa
ctory.java ) there is a method
"public MeshComponent newTexturedSquare(String bitmapName, Bitmap bitmap,float
size) {..."
take a look in there or use this method directly. The Textured2dShape is not
the right choice here i think, bette use the TexturedShape like in the method.
Its a triangle because opengl can only draw triangles so if you want to create
a rectangle you have to use 2 triangles (like in the method;)
Original comment by simon.heinen
on 6 Oct 2011 at 1:56
Thanks alot Simon!
I will try that soon. My last little question: I saw a Blender3D Obj file in
the raw folder and found the ObjParser. Does parsing this 3D models actually
work?
Original comment by raphael....@gmail.com
on 7 Oct 2011 at 10:12
Jep, object parsing and displaying these objects (md3, obj, 3ds and some other
i think, so also animated models!) does work but you will have to use the
ModelLoaderAdapters project (
http://code.google.com/p/droidar/source/browse/#svn%2Ftrunk%2FModelLoaderAdapter
s ) and you will need the libgdx project ( http://code.google.com/p/libgdx/ )
to make the ModelLoaderAdapters work. But if you do so it is easy to load
external models, just check the demo setup in the ModelLoaderAdapters.
Original comment by simon.heinen
on 7 Oct 2011 at 3:20
i finally did a short screencast about how to load 3d models:
http://droidar.blogspot.com/2011/10/loading-external-3d-objects.html
Original comment by simon.heinen
on 11 Oct 2011 at 11:25
Original issue reported on code.google.com by
raphael....@gmail.com
on 5 Oct 2011 at 10:29