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 / vertice manipulation

Author
Message
Jetmech
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 22nd Jan 2003 07:35
Just a little snippet that creates an object and lets you modify it by moving its vertices. I know it can be optimized a great deal, this was just test code, but feel free to give your suggestions.

just replace the texture with one of your own


regujka
21
Years of Service
User Offline
Joined: 23rd Jan 2003
Location:
Posted: 23rd Jan 2003 21:01
Please send me the shader examples: regulyistvan@hotmail.com

Jetmech
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 24th Jan 2003 00:10
ummm no Idea what shader examples your talking about

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Jan 2003 04:34
lmao... don't worry about that guy he's spamming alot
seems to be pretty good, i'd replace alot of the arrays with types for a single array if i were you but on the whole this is certainly interest peaking

Anata aru kowagaru no watashi!
Jetmech
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 24th Jan 2003 05:04
lol yeah I found that out after I moved on and found his spam on a hundred other posts... This was actually some older code I had.. in the project Im currently working on I'm using types.
What i need to work on is a Decent way to update an object from a memblock. the lack of direct access to the objects in memory makes for slow and awkward code...( unless of course im missing something).

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Jan 2003 13:14
well personally i use an array to store and edit the model data (much easier within pro as you can actually contain it to 2 arrays with single elements with types)

you then use a memblock to write the model, or you could always have the same model and only update what you have to.
if you use a type the point is you can actualy edit vertex directly ...

i.e.
type test_vertex
x as float
y as float
z as float
endtype

type dbo_mdl
vertex as test_vertex
endtype
dim pArray(4028) as dbo_mdl

so from that you have pArray(vertex/face index).vertex.x
and you can then edit that value
so you have the whole model in more human terms

see what i'd like to see is open and type arrays so you can combine them into a single type you declare per model and the array can grow to however many vertex and face's you have

Anata aru kowagaru no watashi!
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 24th Jan 2003 17:53
@Raven

thanks - this script is pretty useful, although my code is pretty similar. It is reasonably fast as well - usually mesh deformations don't have to be done too quickly.

NOBODY has a forum name as stupid as Darth Shader. I do.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Jan 2003 21:22
well that code isn't thought for speed... more for ease of use

Anata aru kowagaru no watashi!
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 15th Mar 2003 15:21
Hey, something is missing at the selectvertex(vcount2)function:

if mousex() object screen x(vert+3)-5
if mousey() object screen y(vert+3)-5

those lines do not compile, which should be the comparative ("=" perharps although it does not work)?

I'm working on realtime mesh deformation. This example is very nice.

Thanks!

Login to post a reply

Server time is: 2024-11-24 05:00:51
Your offset time is: 2024-11-24 05:00:51