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.

Bug Reports / [Cloth and particles]. Generate Cloth From Bitmap doesn't work! U6.2

Author
Message
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 25th Aug 2006 20:23
The generate cloth from bitmap command crashes with an error when I try to use it. I'm using a 16x16 bitmap. I use the load bitmap command to load the image to bitmap 1. I'm using 6.2 with the new version of the pack from my order history.



I've attached the source and media.

Also, a feature request for the pack. Could we please have better error messages. Because "a physics error has occured in the dbpro application" isn't a very good indicator.

Attachments

Login to view attachments
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 27th Aug 2006 07:12
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 30th Aug 2006 12:07
Hi, I've tryied the code, but seems that there is something wrong also elsewhere. I've already spent 1 hour on your code & there is something strange I cannot understand. I'll have a look during the day.
Anyway, I've found a funny stuff...
Change your "Load bitmap" command by "Load image"... you'll see that ZOMBIES have passed by there....

coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 30th Aug 2006 18:29
That is totally weired. Could we pleeeeeease have this bug looked at.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 12th Jan 2012 22:15
it's weird to find anther post open from 2006

the change for loading a image let it run but the image did not show up
on the cloth

to move side ways - is to move forward
Since a Strait line gets thin fast
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Jan 2012 08:53

what on forum? (earth)

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Jan 2012 08:58
@MrValentine

this is message for @MrValentine

the post is [Cloth and particles]. Generate Cloth From Bitmap doesn't work! U6.2
http://forum.thegamecreators.com/?m=forum_view&t=87529&b=15

to move side ways - is to move forward
Since a Strait line gets thin fast
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Jan 2012 09:12
Yeah I got that part but 2006

heh but wow is anybody still using it?

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Jan 2012 09:21
other than you and me nope na daaaa

and it's not the first time I've found a forum item open like this

to move side ways - is to move forward
Since a Strait line gets thin fast
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Jan 2012 09:35
Hehe cool I shall have to look upon it as being part of history then

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Jan 2012 18:30
I can't get the snippet to work with any bitmap, i.e. any resolution or any set of colours. I'm using U7.7 so it seems there's a bug - or we need an example of how to use the command.

Yes, people do still use those commands (but I hadn't tried that particular one before).
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 26th Feb 2012 23:34
Hi, I cannot upload a snippet.
This function works.
There was some mistakes in the snippet published in August 2006.

Try the following code :

-----------------------------------------------------------------
sync on
sync rate 60
autocam off
cls


make camera 1
backdrop on 1
color backdrop 1, RGB(100,100,100)
position camera 1,4,0,0
POINT CAMERA 1,0,0,0
set ambient light 30
color ambient light rgb(255,255,255)

Banner1 = 1
Peg1 = 4
Peg2 = 5
Effector = 10
Cloth = 1

make object box Peg1, 40, 40, 40
make object box Peg2, 40, 40, 40
scale object Peg1, 1,1,1
scale object Peg2, 1,1,1
position object Peg1, -2.5, 2, -3
position object Peg2, -2.5, 2, 3
color object Peg1, RGB(0,70,255)
color object Peg2, RGB(255,66,0)

load image "banner_royal_lion.bmp",Banner1,0
make cloth Cloth
generate cloth from bitmap Cloth,Banner1,5,5,0, 1
set cloth mass Cloth, 5
set cloth elasticity Cloth, 3.0
fix cloth point to object Cloth, 0, Peg1, 0, 0, 0
fix cloth point to object Cloth, 10, Peg2, 0, 0, 0

make gravity effector Effector
bind effector to object Effector, Cloth
set gravity effector Effector, 0, -10.0, 0

set object transparency Cloth, 1

rem ************************************************************
while mouseclick()=0

set cursor 0, 0
ink RGB(0,70,255), RGB(255,0,192)
print "3D Cloth & Particles - Cloth Banner Demo - Revised by Marcuswilm - February 2012"

update physics
sync

endwhile

end
------------------------------------------------------------------

Of course you can adjust the variables for a better simulation.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Feb 2012 12:24 Edited at: 27th Feb 2012 18:42
Could you help us by indicating which bit or bits you changed? Please.

Edit Tried your snippet and got "limb does not exist at line 32".

Line 32:



I'm using U7.7RC7.
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 27th Feb 2012 20:18
Hi Green Gandalf


You received this error message because you probably used a too big image (exceeding the recommended maximum of 16x16 pixels)
I used the original "banner_royal_lion.bmp" uploaded by coolgames;
it has a size of 16x16 pixels.

Nevertheless, on my OS (win 7 64bit - PhysX Hardware - screen resolution = 1600x1000) I can use bigger images (40x40 pixels).
The image used by coolgames wasn't a good choice because the generated cloth has too many cuts.
It is better to create a B/W pictures with a majority of white pixels.

Example : (pixel=1=white color ; pixel=0=black color)

1111111111111111 = rows 1,2,15,16
1111011111101111 = rows 3 to 14

This bitmap will produce a squared cloth with 2 verticals cuts inside its shape.

(of course, you can try with a completely white bitmap)

If 16x16pixels is too big for your system, then I suggest you to try the snippet with a smaller bitmap.

By the way, after I posted the modified snippet, I optimized the draping of the cloth thanks to some adjustments in the placements of two boxes and of the pins and I reset the Mass and Elasticity values to 1. (the simulation ran with a cloth generated with a 20x20 pixels Bitmap)

=========================================================
position object Peg1, -2.5, 2, -2
position object Peg2, -2.5, 2, 2

...

fix cloth point to object Cloth,2, Peg1, 0, 0, -1.8
fix cloth point to object Cloth,5, Peg1, 0, 0, -2
fix cloth point to object Cloth, 37, Peg2, 0, 0, 1.8
fix cloth point to object Cloth, 40, Peg2, 0, 0, 2

...

set cloth mass Cloth, 1
set cloth elasticity Cloth, 1
=========================================================
Anyway, I may assure you that my previously posted snipped works perfectly on my computer (assuming that it is running with a 16x16 pixels bitmap).

I hope it can help you.

mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 27th Feb 2012 23:16
Demonstration of this function with this video uploaded on YouTube :

http://youtu.be/mlkJmR4K1A8
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Feb 2012 12:41 Edited at: 28th Feb 2012 12:47
Quote: "You received this error message because you probably used a too big image (exceeding the recommended maximum of 16x16 pixels)
I used the original "banner_royal_lion.bmp" uploaded by coolgames;
it has a size of 16x16 pixels."


Thanks. That was exactly the problem.

I'd forgotten I'd been experimenting and had replaced the original image with a 256x256 copy.

I have to say that the error message is unhelpful though.

It's also rather confusing that "load image" is used in conjuction with "generate cloth from bitmap". That inconsistency is just inviting confusion for the unwary.

Edit The help file is just as confusing on the bitmap vs image issue:

Quote: "Function
Generate Cloth From Bitmap Integer id , Integer bitmapID , Float sx , Float sz , Boolean autoTriangles , Boolean doubleSided

Parameters


id
Object ID of the cloth.


bitmapID
The ID of the bitmap to be used to construct the cloth."


Any user would reasonably expect to use a bitmap rather than an image given that information.

On the other hand it does, as you say, warn about bitmap sizes:

Quote: "Note that although there is no limit on the size of cloth you can create, it is not advised that you try to create a cloth using high resolution bitmaps. Bitmap sizes of around 16 x 16 pixels are usually sufficient."
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 1st Mar 2012 15:02
@Green Gandalf
You're welcome
I just started to learn Dark Basic Pro a few weeks ago.
I think there are newer and better functions to control the PhysX properties (PHY ...).

Not easy to login on this site (probably due to a lot of members and visitors connected at the same time).

Login to post a reply

Server time is: 2024-04-19 13:14:04
Your offset time is: 2024-04-19 13:14:04