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 / How to I move Vertex in a sphere?

Author
Message
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 3rd Feb 2018 18:24


I am attempting to take a sphere and manipulate each vertex individually however when I attempt to do so the Polygons come apart since it seems they are not welded. How would I make it so that when I move each vertex it states connected to all the other polys in the sphere?
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Derek Darkly
6
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 3rd Feb 2018 22:42 Edited at: 3rd Feb 2018 22:43
I'd say you have to figure out which vertexes share the same coordinates and move them all together at once.
Send your parents to noisy sprite demo hell... enter the D-Zone
Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 16th Feb 2018 20:12
Yeah.... Thats insane lol. Ill stick with OpenGL or DirectX I guess. Why are they not Welded.... That TERRIBLE for performance. That's like 36 verts for a simple Cube when they could have used 8.... What were they thinking? That means if they did it correctly DarkBasic would be able to handle almost 4x as many Objects as it currently does... At the very least Twice as many to be conservative.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 17th Feb 2018 02:32
Most Dark Basic Professional if not all, Make Object functions build the object using a triangle-list primitive. So, every three sided polygon in an object uses three vertices. With all the mesh, memblock and vertex data commands, there is no function to build an object of any primitive type. The vertex data is held in video memory. Dark basics DBO format can however display any vertex primitive type it is pointed to.

In my internal version, I have added a function that allows you to build an object of any primitive type you desire. If interested, I can add the finishing touches and post a link. Here is a list of bug fixes and additional functions, so far.

Sedit
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 17th Feb 2018 16:53
I am interested, for multiple reasons, I am working on a graphics library for OpenGL and for DirectX and the Algorithm for Primitive drawings would be helpful. I thought I remember seeing in the past a command to weld vertices in Darkbasic. If so I could picture converting the Primitive into a mesh then weld the vertices and convert it back to an object.

Man I really need to get on the ball making my own DLLs for Darkbasic. I suppose once I get my DirectX lib running I could figure a way to connect it to DB.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 18th Feb 2018 10:09
Hi there.
It's been a long time since I joined the forum last time . The best way to get that is playing with vertexdata . As our friend Derek Darkly has suggested, you shoud move all selected vertex that share the same coordinates at once . You can make your own function to select vertex .
Here's a little 20 lines code I made some time ago .



As our friend WickedX has commented , you can build the object using a triangle-list primitive.
Here is an example:



Quote: "I thought I remember seeing in the past a command to weld vertices in Darkbasic"


The commands you're referring to are GET INDEXDATA and SET INDEXDATA .
Here's a good example of Ian to weld vertex of a cube.



Cheers.
I'm not a grumpy grandpa
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 18th Feb 2018 16:25
Sorry, with work and new interests I have not been able to concentrate on programming in general for quite some time. I forgot about indexing vertices. DBPro has no functions to directly build or change the index and vertex count. chafari's function to weld vertices of a cube must use some indirect method that I wouldn't trust.


Attached is an example I wrote for my Create Object function. I just swapped my function to use IanM's Make Object New function in his Matrix1Util's

Wow, this was coded in 2013, it has been a while.

Attachments

Login to view attachments
Derek Darkly
6
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 21st Feb 2018 00:24

Chafari!
Where have you been? No new threads since 2014?
Sorry guys, off topic, but I love this guy! I wish Chafari was a pro wrestler. I'd have his autograph by now.
Send your parents to noisy sprite demo hell... enter the D-Zone
Chris Tate
DBPro Master
9
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 21st Feb 2018 06:19
Welcome back Chafari
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Feb 2018 09:24
Thanks guys!
I'm not a programmer .I always try to find the solution by myself . As someone told me once ( I always think outside the box )
The truth is that the forum has very little activity lately. I remember those days when we were all trying to answer all threads.
I have really entered the forum almost every day since 2014, and it is also true that many of the questions I would have liked to answer but I have been more time out than at home , and you know me....I like to write examples in my answers and I can only do it when I'm at home with my PC . I have been some time at hospital although now I'm fine ....always with medical checkkups

Cheers.
I'm not a grumpy grandpa

Login to post a reply

Server time is: 2018-05-27 10:56:38
Your offset time is: 2018-05-27 10:56:38