Skip to main content
gamedev.net
🔒 Locked

Odd Shaped Bitmaps

Started by IGotdaQuestion 4 replies 250+ views
Original Post
IGotdaQuestion
IGotdaQuestion
Not sure if this is correct board but anyway. Lets say I have a square with coords of (x1, y1) (x2, y2) (x3, y3) (x4, y4), ok and I can find angles of the line segements that are the sides using trig funcs. but I want to know is How can I display a bitmap (or graphic) within the square knowing only the coords, angles, and lengths?
MattS423
MattS423
Well, I''m not sure I know what your saying, but if you know the coordinates of the top-left corner, and the dementions (hieght & width), you can simply blt the bitmap onto the screen...

Programmers of the world, UNTIE!
IGotdaQuestion
IGotdaQuestion
I''m saying its like:
Width of top = 10 units
Width of bottom = 5 units
Height of left = 20 units
Height of right = 2 units
Odd shaped, so any quad. that can exist how do I blt it to that?
MattS423
MattS423
ok, I have no clue about how to do that.

[edited by - MattS423 on December 10, 2002 2:29:17 PM]
Programmers of the world, UNTIE!
JonnyQuest
JonnyQuest
Two textured triangles. Apart from that, the quad you just specified does not actually exist... (think about it)

- JQ
Full Speed Games. Are back.
~phil
Yann L
Yann L
As JQ said. The quad you described cannot exist in Euclidean space.

The solution is to specify the coordinates of the corner points (vertices), instead of the side lengths. You don''t need more than that, the four 2D coorindates are enough to display the quad. That''s the principle of vector graphics.

To actually display it, you''ll have to use a scanline rendering algorithm. You could alternatively alos use 3D hardware, it works by the same principles and is going to be a lot faster.

/ Yann

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.