Giter VIP home page Giter VIP logo

vuforialibgdx's Introduction

Deprecated

Currently, the repo is deprecated, as it is not working with latest Vuforia SDK and I don't have the time to fix it (I am not doing AR any more). The repo is updated with latest SDK (as of July 2018), but the app sometimes crashes (race condition depending on whether Vuforia or LibGDX initialises first - seems to require some architectural changes compared to previous versions) and the model is not rendered (but the transform matrix seems to be computed correctly).

I'll try to fix it if I find some time in the future, but for now, consider it dead. I'm happy to give maintainer rights to anyone interested in keeping this alive.

If you wish to see the version working with older Vuforia SDK, see here.

VuforiaLibGDX

Example of Vuforia and LibGDX integration for 3D model rendering in augmented reality.

For a more detailed explenation, see this article.

Note: The app will freeze for a few seconds after start up while loading the 3D model, do not panic :)

If you are interested in older versions of Vuforia/LibGDX, check out this branch.

Example screenshot

vuforialibgdx's People

Contributors

daemontus avatar

Stargazers

Andre Filgueiras avatar M1k4el4 avatar Arthur Lee avatar  avatar netspark avatar swimmingsoft avatar sunpan avatar Dan Wyszynski avatar Eugene avatar Fyhack He avatar PSR avatar Kelvin Bulwinkel avatar huijimuhe avatar Commology avatar cfirmo33 avatar Pedro Paulo Amorim avatar MartinRGB avatar B avatar Oskar Korošec avatar  avatar Bowei Shen avatar fshlsjglsgsgs avatar  avatar badboy-tian avatar Vincent avatar ASLai avatar CHEN TAO avatar  avatar  avatar  avatar

Watchers

James Cloos avatar fshlsjglsgsgs avatar  avatar  avatar  avatar

vuforialibgdx's Issues

Handle clicks on model

I've been trying to catch clicks on the 3d model but have troubles with that.
So far I figured out that the clicks get caught if the model scale factor is 1, here's my code

if (Gdx.input.justTouched()) {
	final int x = Gdx.input.getX();
	final int y = Gdx.input.getY(); 
	Ray ray = camera.getPickRay(x, y);
	Vector3 dimentions = new Vector3();
	BoundingBox boundingBox = new BoundingBox();
	mDisplay.modelInstance.calculateBoundingBox(boundingBox);
	boundingBox.getDimensions(dimentions);
	float radius = dimentions.len() / 2f;
	mDisplay.modelInstance.transform.getTranslation(mPosition);
	final Vector3 center = new Vector3();
	mPosition.add(boundingBox.getCenter(center));
	if (Intersector.intersectRaySphere(ray, mPosition, radius, null)) {
		Log.i("test", "click in model");
	}
}

Any ideas ?

Deprecated code

Hi,
I was just upgrading my project (Vuforia/Gdx) and google sent me here because I was looking at drawVideoBackground .
FYI, this method is Deprecated now, you need to use

videoBackgroundTex.setTextureUnit(vbVideoTextureUnit);
mRenderer.updateVideoBackgroundTexture(videoBackgroundTex));

Good luck !

Erroneous matrix parameters for landscape mode

VuforiaLibGDX works perfectly on Portrait mode.
In landscape mode the matrix parameters looks like they are inverted for x and y and the model is inverted.

you can activate Vuforia in Landscape mode using
mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
(added in initAR function inside AppSession and commenting other lines)

Camera not starting

02-19 22:52:33.195 22979-22979/com.github.daemontus.renderer E/libc: Access denied finding property "persist.camera.cfa.packagelist"

error while running (oneplus 5t oreo)

model not loaded

First of all thank you very much for this repo, it's working great.
I tested this app and it loaded the jet model perfectly. But when I tried to load another model (around 1 mb .g3db file) it won't be loaded.
I've been debugging it and find out it maybe the size of the model because when I tried to get the boundingbox width, height, and depth with this code:

BoundingBox box = new BoundingBox();
modelInstance.calculateBoundingBox(box);
        float width = box.getWidth();
        float height = box.getHeight();
        float depth = box.getDepth();
        Log.d("3D SCALE", String.format("width=%f,height=%f,depth=%f",width,height,depth));

It returns for this model:
Jet: width=34.292183, height=6.583758, depth=24.409595
and my model:
House: width=16360.018555, height=7484.190918, depth=23281.628906

is there any way to resize it so that it can be displayed?

Hello

When I´m running your code with android studio, I get several errors, some of them where because of the Vuforia library was not inside where I have solved it and some were for Gradles.
Could you please once tell how to setup the project with android studio, thanks a lot I'm beginner with android and libgdx , Its a new world for me.

Model position doesn't fix

Hi!

I just found your excellent lib and I tried it. But the model doesn't fix on the image target. Here is a gif:
ezgif com-video-to-gif

Could you please take advice for fix it?
Thanks

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.