Drawing my axes

Pages: 12
hello guys, I'm trying to draw my X, Y and Z axes at the top right handside of my screen just like this: https://imgur.com/v6sK2zq,
I can draw those axes in the world space but I don't know how to translate them to that exact position. anyone knows how to do it?
Last edited on
not a lot to go on but unless you are drawing a weapon for an orc or barbarian or something, its axis, not axes :P

to draw them one would normally just make a fat visible line from 0 to N for each ... eg from 0,0,0 to 0,0,100000 and another from 0,0,0 to 0,100000,0 and a third from 0,0,0 to 100000,0,0 ... right? It helps to color code them too, so you can visually tell them apart.

if you want to move them, pick a new zero, and draw from there...
x,y,z to x,y,z+n and x,y,z to x,y+n,z and so on, same as above except the zeros are now something else.

if you want to rotate it as well, you will need a bit more, but its not hard, do you need a rotation?
Last edited on
jonnin wrote:
unless you are drawing a weapon for an orc or barbarian or something, its axis, not axes

The plural of "axis" is "axes" (AKseez).
Doh! I stand corrected, /bow
;-)
@jonnin, I don't think you understand what I want to do, but let's say I want to draw a 3d object at the top right handside of the view space, so that it should always be drawn at that position even if I move my camera and look somewhere else. (It's like a HUD, except it's a 3D thing). I basically want to do exactly this: https://imgur.com/a/rqnMtuY
this is what I have for now: https://imgur.com/g0DXGrS
Last edited on
Oh. The easy way to do that is to draw it as an overlay, not in the scene at all. You can do that by having 2 scenes that get rendered together but are handled distinctly, so moving the camera in one has no effect on the other.

Its a lot easier to do that in 2-d -- if you can draw that thing in 2-d? If its really that simple axis / dots hud, you can draw it by hand in 2-d and overlay that easier than a 3-d overlay (but the 3-d isnt that much harder).
Last edited on
I don't think that an overlay is an efficient way of doing this, I'm sure there has to be some easier way by using the view matrix maybe.
I don't think that an overlay is an efficient way of doing this

Don't optimize prematurely.
Don't optimize prematurely.

I can't afford to do it the wrong/slow way, especially when I'm working on a performance critical program. and by the way that's not how graphics APIs work.
Last edited on
I can't afford to do it the wrong/slow way.

The advice about premature optimization is about allocating valuable programmer effort on tasks that maximize product quality per invested time.

Unless your program is literally a 3D compass, drawing that compass certainly has a negligible impact on your software's performance.

By the way that's not how graphics APIs work.

An "overlay" is an interface concept totally unrelated with the particulars of any graphics API. Clearly you know this, because it was your suggestion.

I don't entirely understand what the difficulty is. Just project modelspace coordinates into NDC space.
Last edited on
You don't seem to understand how graphic APIs work or maybe you don't even know what they are, otherwise I have no idea what you're talking about.
If you say so.
You don't seem to understand how graphic APIs work

... says the beginner who can't figure out how to do something simple.
Fuck this turd.
Heh, the self-proclaimed programming "expert" gets serious blowback to his "bow before me, peasants" rants and he downvotes those who dare have the temerity to laugh at him.

Go ahead, loser, downvote me!
Congratulations, LOSER, you proved my point so very eloquently. Marvelously whiny tantrum, dulbert.
@dutch mind your own business noisy son of a dog, fucking uneducated dutch pervert, mess with me and I cut your mum into slices and fuck her like your father did to your 5cm wide asshole. I bet you can't answer my question and yet you come here and talk like an angry little bitch, go suck a goat dutch pig.
Last edited on
hilarious
It certainly became a circus rather rapidly, the clowns have indeed arrived.
Stop, fewdiefie. You're embarrassing yourself.
Pages: 12