rkstyle Posted May 10, 2018 Share Posted May 10, 2018 Hi masters! Today i try to make box who have one pixel width and height and try to put this box like that. I want to make this result . #box { width:1px; height:1px; position: fixed; top:0px; left:0px; } Someone who show me example how to do this result ? Ty advanced! Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted May 10, 2018 Share Posted May 10, 2018 Why would you want a 3d scene to render a single pixel? Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 11, 2018 Author Share Posted May 11, 2018 That I can draw lines easy Quote Link to comment Share on other sites More sharing options...
Guest Posted May 11, 2018 Share Posted May 11, 2018 Is there a link to Babylon.js here? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 11, 2018 Share Posted May 11, 2018 Your code is CSS, it's for HTML. A 3D box is with Javascript using Babylon.js that use units of measure, not pixels. You can not edit a 3D box rendered with Babylon using CSS You can create lines with Babylon without using boxes Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 11, 2018 Author Share Posted May 11, 2018 Bro i just show what i need to make with babylon. I dont know how to position box and looking for example how to position box like top 0 pixels. For example i use css... Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 11, 2018 Author Share Posted May 11, 2018 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 12, 2018 Share Posted May 12, 2018 With Babylon, point 0 is the center of world. To position your box, you must use a BABYLON.vector3 (0, 0, 0) I still do not understand the use of css Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 12, 2018 Author Share Posted May 12, 2018 Ok after position my box in center how to position this box in top ? box.position.y = ? to top 0 ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 12, 2018 Share Posted May 12, 2018 What you want to do is for 2D. Babylon is 3D. There is no top 0 in a 3D world. an image to coordinate 0 that starts from the angle for an image size. A 3D world has no size and the center of the universe is 0,0,0 There is no pixel in a 3D world, but points, vertices. If you make box.position.y = 5 your box will be 5 units higher up compared to the center of the world. I think what you seek to do is not the proper understanding of using a 3D engine. I really do not understand what you want to do. I think you're confusing something basic to move forward. rkstyle and JohnK 2 Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 12, 2018 Share Posted May 12, 2018 Suppose there is a way to put a box in the top right hand corner of the screen, the screen shows a 2D projection of a 3D space and the projection depends on the camera and camera angle so any change in the camera will move the box from the corner position. EDIT Just beat me too it Dad72 Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 12, 2018 Author Share Posted May 12, 2018 Thank you, boys. I understand why I can not do it! Thank you for explaining to me! Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 12, 2018 Author Share Posted May 12, 2018 Try to control scane and now understand why i have bad think.... Now i can play with scane ! TY https://www.babylonjs-playground.com/#CEFBN6 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 12, 2018 Share Posted May 12, 2018 Oulala. I do not understand what you do : You already have a camera with an attachControl => camera.attachControl(canvas, true); Where does this.camera and this.display come from? why {x: 4, y: 4, z: 4}; and {x: 0.1, y: 0.1, z: 0.1} why this.sphere._scaling (property private) Your variables with "this" are not accessible in test') function : this.arrow, and this.sphere To use "this.xxx" you have to use prototypes or class with ES6 Your PG does not work and has many bug. rkstyle 1 Quote Link to comment Share on other sites More sharing options...
rkstyle Posted May 12, 2018 Author Share Posted May 12, 2018 5 hours ago, Dad72 said: Yes.... I give you previus verion.... Check here https://www.babylonjs-playground.com/#CEFBN6#2 Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted May 12, 2018 Share Posted May 12, 2018 Consider using the particle emitter and as a source using 1px images. However of course, the closer the camera gets the bigger it gets since you are in a 3d environment. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.