Coder Social home page Coder Social logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 6 Oct 2011 at 8:44

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 7 Oct 2011 at 10:12

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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

from droidar.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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

  • Changed state: Done

from droidar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.