Drawing my axes

Pages: 12
Jul 15, 2020 at 6:53pm
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 Jul 15, 2020 at 6:55pm
Jul 15, 2020 at 7:43pm
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 Jul 15, 2020 at 7:45pm
Jul 15, 2020 at 7:53pm
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).
Jul 15, 2020 at 8:01pm
Doh! I stand corrected, /bow
Jul 15, 2020 at 8:05pm
;-)
Jul 15, 2020 at 8:20pm
@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 Jul 15, 2020 at 8:23pm
Jul 15, 2020 at 11:34pm
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 Jul 15, 2020 at 11:37pm
Jul 15, 2020 at 11:40pm
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.
Jul 15, 2020 at 11:59pm
I don't think that an overlay is an efficient way of doing this

Don't optimize prematurely.
Jul 16, 2020 at 1:52am
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 Jul 16, 2020 at 1:52am
Jul 16, 2020 at 2:23am
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 Jul 16, 2020 at 2:26am
Jul 16, 2020 at 5:34am
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.
Jul 16, 2020 at 11:06am
If you say so.
Jul 16, 2020 at 1:40pm
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.
Jul 16, 2020 at 2:25pm
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!
Jul 16, 2020 at 5:05pm
Congratulations, LOSER, you proved my point so very eloquently. Marvelously whiny tantrum, dulbert.
Jul 16, 2020 at 7:35pm
@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 Jul 16, 2020 at 7:37pm
Jul 16, 2020 at 7:40pm
hilarious
Jul 16, 2020 at 7:42pm
It certainly became a circus rather rapidly, the clowns have indeed arrived.
Jul 16, 2020 at 7:58pm
Stop, fewdiefie. You're embarrassing yourself.
Pages: 12