How to draw a circular(?) Texture (like the rings of Saturn)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
paddy
Posts: 25
Joined: Tue Oct 23, 2007 12:30 pm

How to draw a circular(?) Texture (like the rings of Saturn)

Post by paddy »

Hi,

I'm new here & to Irrlicht... just started working with this nice engine
2 weeks ago and my first project is a little solar system. Now I stuck
at the point, where I wanted to draw the rings of planets (such like saturn,
jupiter ect..). I have all the textures, but don't now how to draw them,
so that they appear circular on the surface. Would be very nice if someone
could tell me how to do that :) many thx in advance :)

bye
paddy
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You could do it this way:

Draw a single quad with the correct transformation so that it intersects with the planet as the rings would (flat surface going through the middle of the planet) and you texture that quad with an image which is a circle representing the ring with the required transparency so that when rendered it only shows the actual ring.

Does that make any sense? I don't blame you if it doesn't!
Image Image Image
paddy
Posts: 25
Joined: Tue Oct 23, 2007 12:30 pm

Post by paddy »

I had this thought already with the flat surface. but is there anyway to
let irrlicht create the ring texture (my own is just an rect) ? Anyway, another
possibilty would be to create the ring by-hand in photoshop an then
applie it to the surface.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Best way would be to create the image yourself in photoshop. You could procedurally create it yourself or use a shader to create it but it wouldn't be a particularly easy job to do so photoshop would be much easier for you!
Image Image Image
paddy
Posts: 25
Joined: Tue Oct 23, 2007 12:30 pm

Post by paddy »

hmpf.... i don't get it :( ... tried to create a rotated texture in Photoshop,
but i didn't find a tool there which does the rotation :/ ... could someone
help plz how to do that in photoshop ?

if i have this done, it leads me to another problem ;) how do i create
a simple quad ? I think I can't use a Billboard, cause the rings-plane
should not rotate (BB's are always parallel to the viewers plane).
Do I have to set the vertices in a Meshbuffer by myself ? If so, it would
be very nice if you'd post an short example :)

many thx for that !! :-)

greets
paddy
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Check out the custom scene node example, i dont think it uses mesh buffers but it would do the trick for you, hybrid knows all about the ins and outs of mesh buffers so it's his place to chip in usually :lol:

What do you mean by rotated texture? You can rotate by pressing Ctrl-T and then right clicking and selecting rotate then pull round a corner of the selected area to rotate it, is that the sort of rotation you want?
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

This is all you need for the texture to put on the quad:

Image

Obviously made a little prettier to actually look like the rings of Saturn.
Image Image Image
paddy
Posts: 25
Joined: Tue Oct 23, 2007 12:30 pm

Post by paddy »

JP wrote: What do you mean by rotated texture? You can rotate by pressing Ctrl-T and then right clicking and selecting rotate then pull round a corner of the selected area to rotate it, is that the sort of rotation you want?
Ah ok, I should be able to create a quad using a custom scene node :)
thx for this hint :)

now to the rotated texture... I've made a little draw, so that you understand
what my problem is. I have this rectangular texture an have to rotate it
around an inner circle.

-->

Image

i hope that this is understandable :wink:
I may could create an own brush with the given rect. and then rotate
it by hand, but isn't there any more comfortable way to do this ?!

many thx for your efforts JP :)

greets !
paddy[/img]
Cardinal4
Posts: 97
Joined: Sun Jun 11, 2006 1:20 am
Location: SG
Contact:

Post by Cardinal4 »

That looks like it can be easily replicated using a radial gradient with a custom colourband. I'm not sure whether GIMP has that tool though. :?
Sketches of a rambling mind
Still a long way on learning Irrlicht...
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

In Photoshop: Filter -> Distortion -> Polar Coordinates
paddy
Posts: 25
Joined: Tue Oct 23, 2007 12:30 pm

Post by paddy »

ooh wee ! :D

The polar-coordinates filter does exactly what I wanted :)
many thx for that !

Now I should be "knowledged" enough to complete that planet rings =)
paddy
Posts: 25
Joined: Tue Oct 23, 2007 12:30 pm

Post by paddy »

ok, it works now :) there's only one question left. Additionally to the color map, I have an greyscale "pattern image", which defines different alpha
values at different ring parts, I think. How can I combine these 2 ? Shall
I do that with a special Material Type or can I combine both in Photoshop?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Unless it's something that changes dynamically then just make the changes in photoshop. I'm sure there must be someway to combine the two but i don't actually know how that would be done as i'm not all that much of a whizz at it!
Image Image Image
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

In Photoshop, just add an Alpha Channel to your image, then copy and paste your grayscale image into the Alpha Channel.
Post Reply