Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Make a waterfall by a plain

Author
Message
Jonathan Archer
10
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 30th Jul 2013 00:23
Hi!
I want to create a waterfall making a plain. I tried to add a 256x256 texture to this plain, but It's totally oversized.
So, I tried to use Scale texture object , but I'm unable to find the exact values.



I've the same problem with other plains of different size. Is there a way to ensure that plains of different size have textures that correspond?

Sorry formy English

Thanks!
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Jul 2013 15:46
I think that uses float values - the sprite and object scaling uses percentages, which might be where the confusion is coming from.

So, if you use 0.5 with scale object texture, it should double it up, scale by 0.25 to quadruple it. If you had a texture that you want to repeat 8x8 times on a plain, use SET OBJECT SCALE Obj, 1.0/8.0, 1.0/8.0

It's probably because UV coordinates are in a 0.0 to 1.0 range, so scaling and scrolling are specified in that sort of range, rather than percentages like everything else. At least I think that's the case, it has been a while since I used these commands in DBPro.

I got a fever, and the only prescription, is more memes.
Jonathan Archer
10
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 30th Jul 2013 16:00
Please, help me :-(
Jonathan Archer
10
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 30th Jul 2013 16:14
Van B, thank you for the answer!
I knew that the values have to be percentages, but I'm unable to find the right values. I tried to modify the values "dinamically" in game, but It was useless :-(
I tried to use Scale object, but the plain strangely disappears. Do you know the reason?
Actually, creating a waterfall of lots of plains is the only idea I have, but It reduces the performance, isn't it?
Nabz_32x
15
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 30th Jul 2013 17:08 Edited at: 30th Jul 2013 17:10
It is like VanB said,
I used those commands for the large blocks in my game.

Using SCALE OBJECT TEXTURE <3D Plain Number> , 5 , 5
will repeat the Image both Horizontal and Vertical 5 times on the 3D Plain. (Like a 5x5 grid consisting of the texture Image)

SCALE OBJECT TEXTURE <3D Plain Number> , 1 , 1
Will draw the whole Image you used as a texture on the 3D Plain.
(This is the standart Setting when you first texture your dbpro created 3d plain AFAIK )

For making the effect of flowing water the SCROLL OBJECT TEXTURE Command should be sufficient.

Jonathan Archer
10
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 31st Jul 2013 14:28
Thanks, but I already used Scale object texture to solve the problem (otherwise I had not written a post XD), but It was useless. Maybe the texture is distorted by the plain because It isn't square. Try to texture a plain please, as I did.
Nabz_32x
15
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 31st Jul 2013 23:12 Edited at: 31st Jul 2013 23:14
I used the mentioned method for plains and tris and it works fine.
I don´t know how just scaling the texture would help you creating a waterfall, it would look like something pulsates and not as if it flows.

Scaling and Scrolling are two different things, that you shouldnt get messed up.

I just had a test run and your texture Image should be fully visible when you use it on a 3d plain, when it has a texture scale factor of 1 ( like when just loaded or created ).
This is also the case should your immage isn´t square.

Oh and somehow your Posts only appear for me, after you have posted them 2 hours ago.

Jonathan Archer
10
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 1st Aug 2013 16:51
So, all things considered I think that the most convenient solution is modifying the texture with Paint and repeat it vertically, isn't It? Thanks for all your advices

I Think that they appear so late because I'm a new member, and they have to be checked by moderators

Login to post a reply

Server time is: 2024-04-24 02:21:23
Your offset time is: 2024-04-24 02:21:23