drawing a closed polygone
BlitzMax Forums/BlitzMax Beginners Area/drawing a closed polygone
| ||
Hi.. what are the ways to draw a closed polygone in blitzmax? as im using Xors3d I thought of making polygone from a 3d flat shape.. anyone has a code of turning a 2d polygone into a flat 3d polygone like shape? in other words i need a way to create vertex from 2d a shape. tnx.. anyway im trying to work it up my self until/if someone answers, :) |
| ||
Command: DrawPoly bye Ron |
| ||
Are you serious Derron? What I meant is formula to turn 2d coords poly into 3D Flat mesh. because im using xors3d i cannot draw poly.. Ive already made half of it.. so ill post when its ready as far as i know u cannot paint polygons with textures etc.. there is a lot of advantages in having polygons made from a mesh Thanks anyway |
| ||
Maybe its because you used the word "draw" which is mostly used when speaking about 2D? Its not really that hard to extrude a shape anyway... Double the surface, move it on the correct axis, then find each outer edge line and create a quad using the 4 resulting vertices. EDIT: It also sounds like your source is not triangulated though, so youd have to do that as well before/while extruding. |
| ||
I might have misinterpreted what you want to achieve. Your first sentence contained "[...] what are the ways to draw a closed polygone in blitzmax?" and the last one of the request/question was "in other words i need a way to create vertex from 2d a shape." - which made no real sense so my brain autocorrected it to "create vertexes to form a 2d shape" - which is a polygon. I assume you want to achieve a "top down" look at a 3d-deformed polygon ? So if you have a 5-legged-star and you want one leg to be moved on the 3rd axis (eg. "z") that leg gets "shorter" (as the end point moves toward the center of the star). If so: this is "easy" mathematics (as you can draw in the angles and calculate distances from that). bye Ron |
| ||
Im sorry if im limited a bit in my english.. to describe things correctly.. I find it rather hard to be made.. I will add a picture if I will fail to make it work.. Tnx. |
| ||
Under the assumption that you want what I described: you need to be able to rotate a vertex (A) around two other vertices (B an C). AB form a line, BC too - same for AC. So you could use the mathematic formulas you learned for triangles (and quads - all 4 angles = 360° etc.). When now rotating "A" along BC you know that the distance between A and BC is constant, only the angle changes. Arghh... I have the same problem than you with English and correct descriptions. Maybe this is of interest: https://www.math.utah.edu/~treiberg/Perspect/Perspect.htm bye Ron |
| ||
Thanks Derron |
| ||
Polygone?, that's a dead parrot ain't it!. :D |
| ||
well steve.. i want to create polygons from 3d mesh so i can make 2d graphics with 3d flat polygons.. it gives you more abilities.. in controlling the looks, like giving it textures.. and other effects. its a 3d object after all :) I Promis you ill put good stuff from my engin the ability to create a 2d 3d object from blitz and then control it is great I just realized i can release small stuff that might do good for others.. |