Comments (6)
You're ABSOLUTELY right :) I'll fixed it right now^^
The code for Matrix.OrthoOffCenterLHToRef is in babylon.math.js. Here is the code:
BABYLON.Matrix.OrthoOffCenterLHToRef = function (left, right, bottom, top, znear, zfar, result) {
result.m[0] = 2.0 / (right - left);
result.m[1] = result.m[2] = result.m[3] = 0;
result.m[5] = 2.0 / (top - bottom);
result.m[4] = result.m[6] = result.m[7] = 0;
result.m[10] = -1.0 / (znear - zfar);
result.m[8] = result.m[9] = result.m[11] = 0;
result.m[12] = (left + right) / (left - right);
result.m[13] = (top + bottom) / (bottom - top);
result.m[14] = znear / (znear - zfar);
result.m[15] = 1.0;
};
from babylon.js.
Thank you David :)
Maybe I was not clear in my second sentence, I found the code of this function, but couldn't find the issue in it.
Anyway, do you know why I can't have an orthographic camera on X or Y axis looking at my scene ?
from babylon.js.
Strange...could you share you code so I can try to find the issue?
from babylon.js.
Nothing fancy here. Here is my code :
var canvas = document.getElementById("renderCanvas");
var engine = new BABYLON.Engine(canvas, true);
var scene = new BABYLON.Scene(engine);
// Camera on Y axis looking at (0,0,0)
var camera = new BABYLON.FreeCamera("Cam", new BABYLON.Vector3(0,-10,0), scene);
camera.setTarget(new BABYLON.Vector3.Zero());
var box = BABYLON.Mesh.CreateBox("box", 1, scene);
box.position = new BABYLON.Vector3(1, 0, 0);
var renderFunction = function () {
scene.render();
};
engine.runRenderLoop(renderFunction);
camera.attachControl(canvas);
When I execute this code, nothing is displayed. I have to attach a control to the camera and rotate the view to see my scene.
from babylon.js.
Ohh I know this bug :) This is related to maths^^
just move the box a little bit just to ensure the box is not perpendicular to its target:
camera.setTarget(new BABYLON.Vector3(0, 0, 0.001));
from babylon.js.
Perfect, it's working great :)
Thank you !!
from babylon.js.
Related Issues (20)
- Add a helper function to copy a texture to another one HOT 2
- Input manager : PointerEvent pick with boundingBox HOT 1
- [Unit test] Revise and reintroduce loaders tests
- The example playground from docs doesn't compile in TS HOT 4
- Morph: use a uniform instead of a define for the number of active targets
- babylon webXR AR ground tracking not working in some devices HOT 2
- [XR] Node parented to the XR camera is incorrectly positioned
- Decal map: Add an option to apply it before or after the detail map HOT 2
- Gizmos misbehave when operating on child objects with configured pivot HOT 1
- Uncaught StandardMaterial needs to be imported before as it contains a side-effect required by your code HOT 1
- [Tooling] Support undo/redo HOT 2
- .glTF Export Instanced Meshes as Nodes Pointing to the Same Mesh
- [XR] support graphics-optimized quality in layers
- No Shader found using GridMaterial HOT 2
- How to catch error throw by FileTools.ReadFile? HOT 1
- 动态创建大量的mesh时,MergeMeshes 会不工作 HOT 2
- Increase support for VideoDome
- Add support for .cube LUTs HOT 1
- Title is not correctly centered on input blocks in NME
- Drag and dropping items with autoUpdate that generates inputblock does not offset the new blocks correctly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babylon.js.