Jump to content

3DS Max - Meshes show as artifacts


reddozen
 Share

Recommended Posts

Changing the view range (1,000,000 units) had no effect on my example scene, and neither did removing the scale. I even just tried exporting it again using the latest exporter.... What could I be doing differently that is allowing it to work for you and not me?

 

I've got my script down to almost nothing...

 

index_dongsang.html:


<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head>    <title>Worlds Gate - Test Client</title>    <script src="babylon.1.13-beta.js"></script>    <! -- Load all our map files here --- >    <script src="../Models/Maps/Loaders/Prt_f01_scene2.js"></script>    <style>        html, body {            width: 100%;            height: 100%;            padding: 0;            margin: 0;            overflow: hidden;        }        #renderCanvas {            width: 100%;            height: 100%;        }    </style></head><body><div id='stats' name='stats' style="top: 5px; right: 5px; position: absolute; padding: 10px; background-color: rgba(255, 255, 255, 0.2);"></div>    <canvas id="renderCanvas"></canvas>    <script>        if (BABYLON.Engine.isSupported()) {            var canvas = document.getElementById("renderCanvas");            var engine = new BABYLON.Engine(canvas, true);            var scene = new BABYLON.Scene(engine);            var camera = new BABYLON.FreeCamera("Camera", new BABYLON.Vector3(10, 400, 700), scene);                        // Wait for textures and shaders to be ready            scene.executeWhenReady(function () {                // lights                var sun = new BABYLON.PointLight("Omni0", new BABYLON.Vector3(60, 2000, 10), scene);                // load the prontera map objects                Prt_f01_map(scene, 0);                                // Attach camera to canvas inputs                camera.attachControl(canvas);                camera.checkCollisions = true;                camera.position = new BABYLON.Vector3(-98.49, 5.69, -43.56);                camera.rotation.y = 2.5;                camera.ellipsoid = new BABYLON.Vector3(0.1, 0.1, 0.1);                camera.inertia = 0.7;                //15~18                camera.maxZ =  1000000;                //alert (''+ scene.getMeshByName("Rag2_bro_mtree_a_04").position.X +'');                            });            scene.executeWhenReady(                function ()                {                    engine.runRenderLoop(function() {                        scene.render();                        stats.innerHTML = "<span>Total vertices: " + scene.getTotalVertices() + "<br>"                            + "Active vertices: " + scene.getActiveVertices() + "<br>"                            + "Active particles: " + scene.getActiveParticles() + "<br><br>"                            + "FPS: " + BABYLON.Tools.GetFps().toFixed() + "<BR>"                            + "Frame duration: " + scene.getLastFrameDuration() + " ms<br><br>"                            + "<i>Evaluate Active Meshes duration:</i> " + scene.getEvaluateActiveMeshesDuration() + " ms<br>"                            + "<i>Render Targets duration:</i> " + scene.getRenderTargetsDuration() + " ms<br>"                            + "<i>Particles duration:</i> " + scene.getParticlesDuration() + " ms<br>"                            + "<i>Sprites duration:</i> " + scene.getSpritesDuration() + " ms<br>"                            + "<i>Render duration:</i> " + scene.getRenderDuration() + " ms"                            + "<BR><BR>"                            + "Camera Position: (" + camera.position.x + ", " + camera.position.y + ", " + camera.position.z + ")<BR>"                            + "View Range: "+ camera.maxZ +"";                                });                }            );        }    </script></body></html>

Prt_f01_scene2.js:


var Prt_f01_map = function(scene, offset) {    var Prt_f01_prt_dongsang_inst = 0;    BABYLON.SceneLoader.ImportMesh("", "../Models/Maps/", "prt_dongsang.babylon", scene,        function(mapZone, particleSystems, skeletons)        {            mapZone[0].visiblity=false;            mapZone[0].isVisible=false;            mapZone[0].name = "Prt_f01_prt_dongsang";            ////////////////////////////////////////////////////////            // Instance Copies            ////////////////////////////////////////////////////////            Prt_f01_prt_dongsang_inst++;            objInstance = mapZone[0].createInstance("Prt_f01_prt_dongsang_inst_"+ Prt_f01_prt_dongsang_inst +"");            objInstance.visible = true;            objInstance.isVisible = true;            objInstance.position = new BABYLON.Vector3(-101.492996, 2.988000, -19.001993);            objInstance.scaling = new BABYLON.Vector3(0.001, 0.001, 0.001);            objInstance.rotation = new BABYLON.Vector3(0.000000, 4.712389, 0.000000);        }    );}

dongsang_statue.png

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...