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.

Newcomers DBPro Corner / Drawing a circle on a matrix

Author
Message
D_dredar
15
Years of Service
User Offline
Joined: 6th Jun 2009
Location: The Nevada Desert
Posted: 28th Jul 2009 08:32
Im trying to make a circle the lays on a matrix and follows the contours of the matrix. would anyone happen to know how to do this?

"GOTTA HAVE MORE COW BELL, BABY!!!!!
Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 28th Jul 2009 12:39
A 2d circle lying on a 3d Matrix?

You could feasibly do it with lots of individual boxes lined up into a circle using the get matrix height command and angling them so that they lie on the matrix.


I like work. It fascinates me. I sit and look at it for hours
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Jul 2009 20:25 Edited at: 28th Jul 2009 20:29
Create (or load) your circle image then use Prepare Matrix Texture to cut it into the same X and Z dimensions of the matrix.

Then use nested For..Next loops to tile the matrix.

Using this method, the circle will always follow the contours of the matrix. Note: The bigger the image used, the better the matrix quality.



The above snippet was written in DBC, but should work fine in DBP. If not, it should be enough to point you in the right direction...

TDK

D_dredar
15
Years of Service
User Offline
Joined: 6th Jun 2009
Location: The Nevada Desert
Posted: 29th Jul 2009 09:17
Thank you both for the info, but I should have been more clear about what I wanted to do. Im trying to make a circle that will move around on the matrix when I move my mouse.

"GOTTA HAVE MORE COW BELL, BABY!!!!!
Emphasoft
17
Years of Service
User Offline
Joined: 2nd Jun 2007
Location: Deep Underneath the Center of the Earth
Posted: 8th Aug 2009 22:53
That would involve memblocks. What you should do is the following (pseudo code):


I'm a noob at memblocks, so I can't provide any actual code atm.

Salvation and Sickness are in every heart. Death and Deliverance are in every hand.
-Orson Scott Card

Login to post a reply

Server time is: 2024-11-24 04:24:28
Your offset time is: 2024-11-24 04:24:28