Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing 3DHOP in Rails #33

Closed
mashalahmad opened this issue Mar 12, 2020 · 5 comments
Closed

Implementing 3DHOP in Rails #33

mashalahmad opened this issue Mar 12, 2020 · 5 comments
Assignees
Labels

Comments

@mashalahmad
Copy link

Hi

I got the uncaught reference error at presenter file on the following line
SpiderGL.openNamespace();
error
Uncaught ReferenceError: SpiderGL is not defined

can you tell whats the reason??

@potenziani
Copy link
Member

Hi @mashalahmad

it is not possible to debug your issue without further information (3DHOP version, HW and SW system setup, etc).

Anyway, it seems to be a problem related to the non-inclusion of the spidergl.js file. Please, make sure you've included it in your HTML file (<script type="text/javascript" src="js/spidergl.js"></script>) and in the js folder of your project.

@mashalahmad
Copy link
Author

thanks I resolved that issue. Im trying to implement 3DHOP in rails. I am able to see the background image but model is not loading here is the piece of code
var presenter = null;

function setup3dhop() { 
	presenter = new Presenter("draw-canvas");

	presenter.setScene({
		meshes: {
			"Gargoyle" : { url: "assets/images/cube.ply" }
		},
		modelInstances : {
			"Model1" : { mesh : "Gargoyle" }
		}
	});
}

$(document).ready(function(){
	init3dhop();
	setup3dhop();
});

I got the error "404 model not found".
Now in rails usually images are put under the assets/images folder I put the background images there and they are loading but not the model

@mashalahmad
Copy link
Author

here is the screenshot
error

@potenziani
Copy link
Member

potenziani commented Mar 13, 2020

Hi @mashalahmad
I do not have experience with Rails, so my help can be only partial.

In a common setup (local/remote HTTP web server) changing the relative folder of the resources (skins, css, js, models) is not a problem for 3DHOP. Of course, this means you have to update all the paths pointing those resources (and this could be the error causing the SpiderGL issue you reported previously).

Anyway, what you are reporting is really strange, since usually the HTTP error 404 simply means that the resource you are trying to load not be found on the server... But, if (starting from the folder with the HTML file containing the 3D scene setup) the relative path of the model is right (assets/images/cube.ply), and the model cube.ply really is in the assets/images folder, it should work...

@mashalahmad
Copy link
Author

yeah im also very amazed. the same thing was previously happening to my background image so I included the ruby tag and background image was then displayed. Im not sure if I can do the same with java script in ruby or not. thanks btw

@potenziani potenziani changed the title Error at spiderGL Implementing 3DHOP in Rails Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants