473,785 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conversion from 3d coords to 2d

Ok, here is the deal.

I want to do this.... i have a group of cubes, i want to draw them,
and then rotate, etc,etc. i've already tried DirectX 9 but now i want
to draw the images direct to a picturebox... i know about some
formulas, but i can't find them.... does anybody know how to do
this???
Nov 20 '05 #1
1 1376
You have so many options its amazing. Using direct 3d is your best bet of
course because it comes with all the gizmos you need. Otherwise, you will
need to create your own (fairly simple) classes.

You will need:

A matrix class (3x3 or 4x4, prefer 4x4)
A vector class (x, y, z or x, y, z, w)

Then, after rotating/translation/scaling your cubes, you simply multiply
each point by the perspective transform matrix, or more simply, something
like x = x / z, y = y / z (scaled up to fit into the window).

There are literally thousands of tutorials around the net on how to do this.
Perhaps you should google for "3d matrix math", "perspectiv e transform",
"vector matrix multiply".

Good luck.

"Antonio Orozco" <ca**********@h otmail.com> wrote in message
news:c7******** *************** **@posting.goog le.com...
Ok, here is the deal.

I want to do this.... i have a group of cubes, i want to draw them,
and then rotate, etc,etc. i've already tried DirectX 9 but now i want
to draw the images direct to a picturebox... i know about some
formulas, but i can't find them.... does anybody know how to do
this???

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
27792
by: Ian.H | last post by:
Hi all, I don't have ImageMagick installed currently (and not sure if this has the ability or not anyway yet), but I've done some googling and not come up with much (if anything) regarding this. I'm hoping to write a script that I can use to accept user input for x,y coords for an image size. The image would initially be stored in SVG format for quality and would like to then resize this according to the users dimension specifications...
1
5362
by: Dave Harris | last post by:
I have written a reasonably clean way to perform coordinate transformations on a polygon, but Tkinter Canvas is not being particularly cooperative. The following program has been distilled down to a minimum and generates a traceback (see below) when it runs. It appears that the create_polygon() method is more versatile than the coords() method. Could someone can suggest a way to have the list comprehension not generate tuples, that...
1
5655
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases at the bottom. Hope you can help me understand the "explicit" keyword and its usage. Specifically, Is "explicit" keyword only associated with constructor in C++? What's "implied conversion of types"?
2
10982
by: Stimp | last post by:
I remember doing something like this before, but it's been a while since I've touched javascript... I have a standard <img> and when a user clicks the image I want to output the IMAGE x y coordinates of the mouse click (i.e. not the page x y coords). I know that appending 'ismap' to the image tag will give me the image coordinates, but I can't use that since the img already has a 'usemap' attribute.
11
7623
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type Test. I expected the same error from the following line, but it compiles fine. The double is silently truncated to an int and then fed in to the implicit conversion operator. Why does this happen? Is there any way that I can keep the implicit...
3
2093
by: tommydog | last post by:
i am trying to generate an image map from the mouse coords of a click. i can pass the X Y through ok as $_POST $_POST how should the string be put into the AREA tag ? i am keeping the diameter as 10 this is what i am trying: echo "SHAPE=CIRCLE COORDS="'.$_POST.',143,10">";
3
12569
by: Matthias Vodel | last post by:
Hi all, I want to change the beginning/end-coordinates of a canvas.line item. Something like: self.myCanvas.itemconfigure(item_id, coords=(x1_new, y1_new, x2_new, y2_new)) I don't want to delete and repaint a new line item. Is this possible?
0
1955
by: Head In A Pan | last post by:
Hello! I have a basic javascript mouse tracker which captures the X&Y coords of the window & displays them in two separate text fields. What I am desperate to do is to post these values to dynamic text fields in a flash file in real time. The swf is sitting on a different frame within the same frameset. Has anyone done something similar before or able to help me? I am only just learning the basics of js.
1
2735
by: jojoba | last post by:
Hi I am trying to determine coordinates of something in a webpage. All i have is a subset of html that i know exists in a given webpage. Now i want to find that subsetHtml in the page and determine the exact pixel coordinates for the elements that subsetHtml comprises. I'm pretty sure i know how to get the pixel coords once i have the elements. The hard part is going from plain HTML to actual elements. Any ideas thx,
3
2823
by: Rhishabh07 | last post by:
how to define coords in an image for an area shape i m using <img src="left.jpg" width="350" height="29" alt="Planets" usemap ="#planetmap" /> <map id ="planetmap" name="planetmap"> <area shape ="rect" coords ="0,0,199,29" href ="sun.htm" alt="Sun"> <area shape ="circle" coords ="200,0,350,29" href ="mercur.htm" alt="Mercury">
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.