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 / AGK torus Primitive

Author
Message
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th Dec 2018 14:10 Edited at: 15th Dec 2018 21:12
Hi guys ! I come up this time with an easy way to make a torus withing AppGameKit . I hope you like it !




Cheers.
I'm not a grumpy grandpa
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Dec 2018 19:17
Thanks Chafari looks good
but I had to change a few things to get it to work firstly the raw path to "media\torus.png"

and then this part of the code as verts - 1 got an errow saying object 1481 did not exist

fubar
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th Dec 2018 21:09
@fubarpk Thanks for testing it . About the raw path, I can understand it ... I've got different PC system at home and sometimes things like that happens. About error "object 1481 " I tested your configuration and I get a hole in the torus. I can't understan it. I'm still using my old Laptop ten year old with Windows Vista . Perhaps new OS works different .
I'm not a grumpy grandpa
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Dec 2018 22:26
yeh I get a hole too but it didn't get the error 1481 and I just wanted to see it work. I believe there is some
difference in the number of vertices and the object number that just seemed the quickest fix for testing
but I like what you have there. Ive played around with torus objects myself and created a hooptoss but
found the only way I could achieve was to Create3DPhysicsDynamicBody(hoop) and SetObjectShapeCompound(hoop)
and having several addobjectshapesphere commands. This allowed for the physics collisions
to work correctly
fubar
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Dec 2018 09:07 Edited at: 16th Dec 2018 09:11
Hi there.
For those who want to test this code, we have to use window properties and display properties 1024*768 otherwise the code won't work .

Explanation
For some razon, Appgamekit getimage and saveimage doesn't save the same quantity of pixels ... so I had to grab a portion 1,1,17,36 to save an image of 15*32 pixels. Why this size and not others ??
The rason for this size is because I'm using the mesh of a suppose terrain with 15*32 vertexs to build up the final Torus using Vertexdata

I'm thinking...instead of saving image to load again...we could use any image with size 15*32 pixels . Givit a try !

Cheers.
I'm not a grumpy grandpa

Login to post a reply

Server time is: 2024-04-26 09:00:47
Your offset time is: 2024-04-26 09:00:47