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 / Collision problem with sparky

Author
Message
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 3rd Jan 2012 21:41
Hello, I ran into a problem with my collision. At the beginning I was using two separate .x files for the same LEGO brick the only difference was that one was turned for 90 degrees. But I want only to use one file. So I tried with "rotate object" and "yrotate object" to rotate my object and then "sc_updateobject". But the collision box doesn't turn 90 degrees. Also tried with built-in commands. The update command is into my loop because the bricks move on the Z axis, this works fine with update command.




Inside loop
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 4th Jan 2012 13:47
Here is my complete source code with the 3d models needed.

The agreements for the models http://www.ldraw.org/Article227.html

Object 2 is the one that doesn't work, object3 is how i did it before with an extra file. I hope that someone can help me.

Attachments

Login to view attachments
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jan 2012 20:02
I have tested your game, and I think that for this king of game you don't need sparkys...you can use normal collision commands and set collision to polygons ....I got up to 51 points

Cheers.



I'm not a grumpy grandpa
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 4th Jan 2012 20:21 Edited at: 4th Jan 2012 20:22
Tried with set object collision to polygons but it is less accurate than set object collision to boxes, and both of them got the same problem which i am having with sparky the collision doesn't rotate together with the object.

Maybe it matters don't know but I'am using U77 RC7
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jan 2012 22:17
What do you want exactly the blocks to do when collision ? rotate block ??

Cheers.

I'm not a grumpy grandpa
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 4th Jan 2012 22:36 Edited at: 4th Jan 2012 22:44


I have activated sc_drawobjectbounds so you can see that object 2 isn't having his collision box normal. It isn't turned 90 degrees. Object 4 and 5 are the same brick and not turned so collision box is good.
Object 3 is turned inside the model editor and then saved under another name. Don't want to use this method because I don't want to make 360 files for every degree. If I expand my program
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jan 2012 22:49 Edited at: 4th Jan 2012 23:45
Let me find out what happens and I will be back.


Edited.

That's strange ...I have activated sc_drawobjectbounds for all objects, and the object bounds are perfect. I'm using windos vista and U77 RC7



Cheers.

I'm not a grumpy grandpa

Attachments

Login to view attachments
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 4th Jan 2012 23:29 Edited at: 5th Jan 2012 16:37
I'm using windows 7 64bit and U77 RC7

EDIT: tried a few seconds ago with the same code that I have uploaded on a windows 7 32bit pc but also the same problem

I just find it strange that only I am having this problem because no one else has complained about it. If someone is reading this with a windows 7 pc can he test my code that it works fine like by chafari on its vista pc. So I know the problem is by me or by the OS and DBpro.

Friendly greetings
aparri
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location:
Posted: 7th Jan 2012 16:28
1beginner1, I have the same problem... Windows 7 breaks Sparky's collision if you rotate (or scale) an object.

I second chafari on using the built-in collision, otherwise you need to use a separate model for rotated blocks.
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 9th Jan 2012 16:54 Edited at: 9th Jan 2012 16:55
It also breaks the built-in commands I think. This what I'm using as code

And inside loop


Same problem as with sparky.
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 10th Jan 2012 22:05 Edited at: 10th Jan 2012 22:07
found the problem it is the command fix object pivot. Tested it with this code.

is it a bug or am I doing something wrong. I think it is a bug to my opinion.
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 11th Jan 2012 04:13
1beginner1 - I too think you have found a bug. Using this alternative code works, but it isn't the best solution:
1beginner1
14
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 12th Jan 2012 18:37 Edited at: 12th Jan 2012 18:51
Thanks for the code got only one problem and that is that I don't use textures for my colors they are inside the 3d model .x So I loose the textures and also need to give make object a value for the image number or I will get an compile error. I can use an non existing value for it to let it compile.

EDIT: went through all the commands in the help file and I think the only two options are OBJECT COLOR and OBJECT TEXTURE. I think the RGB values are public so that wouldn't be so hard. But was hoping for a command like GET OBJECT COLOR .

Login to post a reply

Server time is: 2024-05-08 20:48:31
Your offset time is: 2024-05-08 20:48:31