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 / Is there anyway to transform a plain into a cylinder shape?

Author
Message
Scotty1973
AGK Backer
15
Years of Service
User Offline
Joined: 2nd Jun 2011
Location: Burton-on-Trent, uk
Posted: 6th May 2012 19:37
Hi

Is there anyway to transform a plain into a cylinder shape?

I want to create a plain and using a bitmap(for position) glue cubes to the object. This i know how to do but I then want to transform the plain object(with glued cubes on) into a cylinder shape object with the attatched cubes pointing outward. Is there anyway of doing this?

Was wondering if it would be meshes or using memblocks. I have not used these things very much at all and dont know where to begin.


Many thanks,

Scotty
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 6th May 2012 21:10 Edited at: 6th May 2012 21:11
1) lock the vertex data.

2) use a bunch of SET VERTEXDATA POSITION, SIN and COS commands to bend the plain into a cylinder.

3) calc surface normal vectors to rotate the CUBE objects into position.

4) unlock the vertex data


EXCEPT, it wont be a cylinder just a tube. You would need to create caps on both ends to form a cylinder. You could use the first and last row of triangles to do this.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 6th May 2012 22:19
You can create a multi vertex plane using Matrix1 Utils (If you already did not know, this plugin is in the DLL forum, near the top)



I personally would have animated the effect in Blender (or another 3D editor) but that is only because I find that easier; others may find programming it easier.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 7th May 2012 01:23
Hi there.
@Scotty1973
Yes...as our friend comments, we can do that with vertexdata and if we want to convert exactly a plain to a cylinder, then you will need matrix1 utils as Chris Tate says....I use my own method aswell made with triangles.Use this piece of code with any of your images to make a cylinder made of triangles.





Take a look to this thread to see some examples.

http://forum.thegamecreators.com/?m=forum_view&t=181531&b=1

Cheers.

I'm not a grumpy grandpa
Scotty1973
AGK Backer
15
Years of Service
User Offline
Joined: 2nd Jun 2011
Location: Burton-on-Trent, uk
Posted: 7th May 2012 20:46
Hi People

Thanks for the input with this, much appresiated

@chafari

Really like your ideas and have been playing around with them, Thanks.



Many thanks all

Scotty

Login to post a reply

Server time is: 2026-07-08 05:38:23
Your offset time is: 2026-07-08 05:38:23