Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically adding 3d objects and textures in android

I am using Rajawali for 3d rendering in my augmented reality project in android. I want to add 3d models from remote server on marker detection. I also want to change the texture dynamically after downloading PNG from remote server. Now that 3d initialization will be done only once so how can i add another 3d models to the scene?

like image 953
gooner Avatar asked May 01 '26 01:05

gooner


1 Answers

The code for downloading and parsing of 3d objects should go into "foundFrameMarker" function since in your case the 3d models are not known during initialization.

Once the marker is recognized you can trigger the 3d model download and move the downloaded objects to the SD card (programmatically‎). There should be an API to load the model from SD card. For Obj files the following API should work!

ObjParser objParser =  new ObjParser(RajawaliRenderer renderer, String fileOnSDCard)
objParser.parse();
BaseObject3D 3dModel = objParser.getParsedObject();
like image 147
hsemar Avatar answered May 02 '26 14:05

hsemar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!