Jump to content

How to create box who have size 1 pixel ?


Recommended Posts

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 .

position: fixed;
Someone who show me example how to do this result ? Ty advanced!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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.


  • Recently Browsing   0 members

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