Axis Display in Irrlicht

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Axis Display in Irrlicht

Post by Mr_Ridd »

Hey

I'm writing a 3D level editor and I need to display the axis in the bottom left hand corner of the screen. Like the way Maya and 3DS Max do it. The problem is that I can't just draw lines because if I move my camera then they will disappear.

What other way could I do this?

Thanks
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

If I understand you well, use an image?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

Thats not gonna work because I need the image/line/whatever to rotate according to the camera. If you look at Maya or 3Ds Max you will see what I mean. Not the big grid in the middle of the screen, the little axis lines at the bottom left.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

If it has to face the camera (always), then you could use an image as a billboard and place it at the right position (srry, no Maya nor 3DS here :)) ?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

The problem is that it's not just a flat image. What I basically need to know is what axis the camera is looking down?
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

Yeah, thats what I was originally going to do but I need the lines/axis to stay in the same place on screen regardless of how I move the camera. I think what I will have to do is attach the lines to the camera via co-ordinates. I can't use attachChild() because then they won't move.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Then they will move, they'll change their position according to the camera's position. Or is this what you want?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
turboferret
Posts: 49
Joined: Thu Aug 12, 2004 12:42 pm
Location: Sweden
Contact:

Post by turboferret »

couldn't you use

Code: Select all

core::line3d<f32> getRayFromScreenCoordinates(
00084                         core::position2d<s32> pos, ICameraSceneNode* camera = 0)
in some way?

if you use that and just make it a little shorter you get one of the lines you need (Z). then just rotate it in the correct angles and you have your axis'.
This monkey is useless, it only has ONE ass!!!
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Is there some reason you can't use the axis dependant billboards that are in NX for this purpose?
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

couldn't you use

code: core::line3d<f32> getRayFromScreenCoordinates(
00084 core::position2d<s32> pos, ICameraSceneNode* camera = 0)


in some way?
Not really. That won't give me a fixed position.
Is there some reason you can't use the axis dependant billboards that are in NX for this purpose?
Perhaps I don't understand billboards.
Would you have a screenshot that I could see what you mean?
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

A billboard is a 2D image which always faces the camera (rotates, but does not change position..[/b]
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

...and an axil dependant billboard doesn't rotate to face the camera in one direction, so if you disabled the Z axis one then it wouldn't rotate on the Z axis but would rotate to face on the other two, therefore always aligned with the Z axis. This isn't implemented in Irrlicht but is in NX, although I've not used it yet. It should be exactly what you need for this.
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

It's sounds like it will work. I can't get IrrlichtNX though because I can't connect to the server.
calimero
Posts: 45
Joined: Sun Aug 08, 2004 4:31 pm
Location: Nice, France

Post by calimero »

hello, I'm the author of the axial billboard stuff (with some help of people around here :D )
the version put in irrlichtnx is a little buggy but I think you can try it to see if it suits your needs. The new version is in the new patch section of the irrlicht forum but unfortunatly not put in the standard release of NX
Post Reply