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.

Code Snippets / [DBP] - Object Skew

Author
Message
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 11th Jan 2014 22:54 Edited at: 11th Jan 2014 23:21
I needed an easy way to make a conduit/cylinder skewed so as to be able to make simple inclined/declined hallways for connecting rooms.



It turned out to be simpler than I thought.
This example skews the object along the X axis according to the vertex height.



D.D.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 12th Jan 2014 00:56
Quote: "It turned out to be simpler than I thought"


Yeah , we can make an elbow with several skew cylinder.

Now try to figure out, how to apply animation in real time

Cheers.

I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Jan 2014 19:45
Quote: "Yeah , we can make an elbow with several skew cylinder.

Now try to figure out, how to apply animation in real time"


I wish!
My ability is limited because of my lack of math concepts.

(I'm too lazy to learn trigonometry, etc.)

D.D.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Jan 2014 22:14
Quote: "(I'm too lazy to learn trigonometry, etc.)"


When we set vertexdata position, we can check if vertex y are higher than 0 and if YES, we skew vertex. So knowing that, imagine that we decide to get only vertex higher than zero, and not all of them but every three vertex. Could be something like this:



And for animate vertex, could be like this:



I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 15th Jan 2014 22:31
Nice!
I never thought about rotating the object while changing the vertex positions. And no trig required, so it's way easier for me.

D.D.

Login to post a reply

Server time is: 2024-04-23 18:51:20
Your offset time is: 2024-04-23 18:51:20