Jump to content

Error INVALID_OPERATION: drawElements ?


Dad72
 Share

Recommended Posts

I have a error in the console that i don't understand. What is this error? 

 

Error in Google Chrome
 

256 WebGL: INVALID_OPERATION: drawElements: attribs not setup correctly                                            babylon.js:2
WebGL: too many errors, no more errors will be reported to the console for this context.


this function :

BABYLON.Engine.prototype.draw = function (useTriangles, indexStart, indexCount) {        this._gl.drawElements(useTriangles ? this._gl.TRIANGLES : this._gl.LINES, indexCount, this._gl.UNSIGNED_SHORT, indexStart * 2);};

Or

(function() {with (this[2]) {with (this[1]) {with (this[0]) {return function(event) {SelectedMesh("Modeles/Rabbit/", "Modeles", "Rabbit.babylon");};...}}}})

Error In Firfox :

 

 

 

I did not have this problem with previous versions .

Link to comment
Share on other sites

Yes I managed to find the problem. If i wrote:

function init(CheminModeles, Fichier, Name){    engine = new BABYLON.Engine(container, true);    scene = new BABYLON.Scene(engine);     BABYLON.SceneLoader.ImportMesh(Name, CheminModeles, Fichier, scene, function (newMeshes, particleSystems, skeletons){        modele = newMeshes[0];    }); } function SelectedMesh(chemin, dossier, meshe){    if(modele){        modele.dispose();    }     init(CheminModeles, Fichier, Name);}

I had some errors because of  modele = newMeshes[0];

 

if i delete :

    modele = newMeshes[0];

and 

    if(modele) {
        modele.dispose();
    } 

 

not error.

 

I don't know why. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...