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 / vertex creation and manipulation

Author
Message
Masqutti
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location: insanity
Posted: 22nd Jan 2010 10:08
Hi!

I\'m posting this here as I didn\'t get answers much on the DBPro forum. I guess this is too newblike question then

There\'s a Newsletter\'s tip of the month that teaches how to use vertex manipulation to render 10,000 trees. Basic idea is to create a plane, make a mesh of it and then add the mesh to vertexdata of that object, to say, fill the object with vertexes.

after that reposition the vertexes to match the tree-coordinates. Ok great idea. But i don\'t seem to get it working. Only way i can do something to mesh is to convert mesh to vertexdata. but that ain\'t suitable for this.

[href]http://www.thegamecreators.com/data/newsletter/newsletter_issue_73.html#12
[/href]

this is the code.

I tried it simplifying with this(doesn\'t work, returns empty object, or invisible):


hmmmh.. that didn't compile
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jan 2010 11:38
I don't know, but it seems that you are creating the triangle facing away from the standard viewport (along the Z-axis). Seeing as it is flat, it won't be visible edge on (or from the behind for that matter, seeing as it's a one-sided polygon).
Try creating it along the X-axis instead.
Also, your vertexdata position changing will change the first triangle, and not the second, as I got the idea you were trying for. The first vertices are from the initial (triangle) object, the last from the added mesh.

Masqutti
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location: insanity
Posted: 22nd Jan 2010 12:34 Edited at: 22nd Jan 2010 12:36
ok.. we'll I have tried set object -command to check the culling off, so it views object from both sides etc. So it's not that.

But i'll have to check the thing about positioning the second polygon instead of first :o Tho.. I believe it should work with first also even as it was the wrong one I thought it to be ??

hmmmh.. that didn't compile
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jan 2010 13:04
It has nothing to do with culling; the vertexdata only contains one side. If you want a backface, you have to create that as an individual set of vertices (to flip it backwards, you specify the vertices in reverse order).

Masqutti
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location: insanity
Posted: 22nd Jan 2010 13:11
oh my.. What about the culling then.. does it make doublefaces for objects when your culling is off or what ? But thanks, i'll try those things ôut ^^

hmmmh.. that didn't compile
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jan 2010 17:12
The culling flag tells the engine not to render triangles that are behind any visible surface on the object, as seen through the current camera.

Login to post a reply

Server time is: 2024-09-28 14:27:11
Your offset time is: 2024-09-28 14:27:11