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.

AppGameKit Classic Chat / limit to 3d objects+physics??

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 00:49 Edited at: 14th Jan 2019 00:58
a 3rd option is to have a plane primitive in my arsenal of assets,and simply place it on the ends of the inner walls,offset by 0.1 along whatever axis, and again with zero physics.

I can place my objects with visual and total precision so god knows why i did not think of this simple solution before,i keep all the speed that I so so need!
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 01:58 Edited at: 14th Jan 2019 02:03
ok,all went to plan, first I created another edit box called ObjrD for setting setobjectdepthreadmode()



then i created a scaled inner wall, then scaled down to 1,1,1, changed objectdepthreadmode from 1 to 2 and placed a box both ends of the scaled block,but both without physics..


As you see job is done,easy solution for me,but thanks for all the help..
though I had better use a plane really not a box as you see it shows up with the lights!!
ps,forgot to unhide the roof after editing,that is why it aint visible in the 2nd shot,I can hide/unhide any object(s)marked as being a roof,made life so much easier editing wise!!
Hail to the king, baby!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Jan 2019 04:01 Edited at: 14th Jan 2019 04:07
This works via updating a .obj file. I'm sure puzzle dude could whiz through a mesh map and do the same thing in real time.

It woks in two steps;
First you call ScaleInit() which returns a model structure (This loads in the cube.obj file and does a little setup)

Then you call ScaleCube(filename, model, x_scale, y_scale, z_scale)
ScaleCube will create a .obj file named filename (you need to add .obj) scaled by x_scale, y_scale, z_scale. model is the structure returned from ScaleInit()
Note that if you don't use the "raw:" prefix it will place the file in C:\Users\your_name\AppData\Local\AGKApps\your_app\media

It's a bit of a hack and could be a lot more efficient but i figured seeing as it's a map editor you could just copy over the files to your game

Anyway. Hope it works for you

Note the cube in the image has been scaled x=2, y=3, z=4

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Jan 2019 05:00 Edited at: 14th Jan 2019 05:01
If you use this algorithm to change the UV's of the cube.obj mesh then i think it will work. (Assuming that the order is the same as the .obj file and it starts from zero)
It MUST be the cube.obj file. It will not work with a standard box shape

Where X=(x_scale - 1), Y=(y_scale - 1) and Z=(z_scale - 1)

U(0) Add X, V(0) Subtract Z
U(1) Add X
V(3) Subtract Z
U(4) Add X
V(6) Subtract Z
U(7) Add X, V(7) Subtract Z
U(8) Add Z, V(8) Subtract Y
U(9) Add Z
V(11) Subtract Y
U(12) Add X, V(12) Subtract Y
U(13) Add X
V(15) Subtract Y
U(16) Add Z, V(16) Subtract Y
U(17) Add Z
V(19) Subtract Y
V(21) Subtract Y
U(22) Add X, V(22) Subtract Y
U(23) Add X


Let me know if it doesn't work and i'll recheck my numbers
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 05:22 Edited at: 14th Jan 2019 05:27
it is okay guys,i am pleased with this,now i simply cap the ends with a plane,using it to mask the ugliness:



so the wall i am staring at, the inner one, has been scaled along the x-axis with texture repeat however you do not see the end faces as a plane covers it!
it is a pure cheat i know, but anyhow!! the scaled wall object,has physics and the plane does not
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 05:35 Edited at: 14th Jan 2019 05:36
here is a screenshot in the editor to show what i mean
the said plane has been selected,hence it has a black dull texture:

Hail to the king, baby!
puzzler2018
User Banned
Posted: 14th Jan 2019 08:43
Wow there is some really interesting things here from bkink0k too. Well done for thinking like this
Your scenes look great too. We'll done
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 14:03 Edited at: 14th Jan 2019 14:12
i tried for days and days until the brink of insanity,which cube works? I lost count!!Also is there a limit to how many lights I can have?

ah,a rar file,ok i will look at it,cannot let your efforts be wasted!!
Hail to the king, baby!
puzzler2018
User Banned
Posted: 14th Jan 2019 14:10
Well done anyway.

With the lights. I don't think there is a limit. But you have to assign your own light ID to the lights commands
Like
Createpointlight(1......
Createointlight(2....
Createpointlight(3......
...
...
...

Etc etc

Others may have an idea if limits
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 14:15
if there is no limit,then all of a sudden there is something majorly wrong with my code..lol
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 14:17 Edited at: 14th Jan 2019 14:24
I will code a quick demo to check the lights situation,seperate from the engine.

EDIT
Wont be quick actually,my friggin tablet is dead!!


And after will try blinks stuff,I totally thought it was the model itself and how it is created!!
Hail to the king, baby!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Jan 2019 14:24
Quote: "Also is there a limit to how many lights I can have?"

lights take up allot of resources I found at most ive been able to get to work reliably was four
anymore than that and the frame rate went out the window
fubar
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 14:25
it does 4 for me also,then kinda wont work,or the others before it stop working if i try >4
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 14th Jan 2019 14:28
I own the shaderpack,does that make odds,I was going to add it all into the engine anyhow!!
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 15th Jan 2019 00:14 Edited at: 15th Jan 2019 01:56
@blink0k

Thanks sp much, I got your code into the engine and works brilliant!!
Added to my assets!

**edit***
Well it was working..damnit
Hail to the king, baby!
puzzler2018
User Banned
Posted: 15th Jan 2019 07:37
How you mean now not working. Could you elaborate what decided to not work anymore when it was
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 15th Jan 2019 14:40
well,it was working,then it wasnt,thats about it,pretty sure it works just once!! do you have to delete a file before saving it if it already exists or something like that??

I do that in my save_level() function foe level data also!
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 15th Jan 2019 14:41 Edited at: 15th Jan 2019 17:36
hmm..nah cant be it
EDIT
Never mind boys/girls, I will manage with what I have, it looks good enough and i will mask off ends with planes,no biggy
here is my progress and time to move on for the sake of a frigging cube...
Hail to the king, baby!
puzzler2018
User Banned
Posted: 16th Jan 2019 10:15
Great work keep it up

Login to post a reply

Server time is: 2024-03-29 15:35:23
Your offset time is: 2024-03-29 15:35:23