Sign in to follow this  

Placing Object in World.

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am trying to understand about coordinte transformations. I would like to place a straight line in the existing code. I know the world coodinates, Camera coordinates. Can some one please tell me the sequence to be followed to draw a small straignt line. Regards, Kiran.

Share this post


Link to post
Share on other sites
Erm, so you just want a small straight line somewhere in the world? if I understand you correctly, you're going to have to use D3DPT_LINELIST with one of the DrawPrimitive functions. First you're going to have to setup a buffer with two vertices in it that represent the beginning and end of your line, and before that you're going to have to make sure you have defined the vertex format you want.

Look up D3DPT_LINELIST in the documentation and go from there.

Share this post


Link to post
Share on other sites
Hello RedLine,
Thank you for your advise. What I am exactly looking for is: I want to place the straight line at some point in the world whose coordinates are known. The world coordinates are some thing like X = 15000, Y = 10000, Z = 1000. Then how should I use the transformations?

Thanks,
Kiran.

Share this post


Link to post
Share on other sites
A few good books covering essential 3D maths are

- 3D Math Primer for Graphics and Game Development
- another by Peter Lin .. something by the name of 3D graphcis programmign on Linux volume -1. covers transformations probably the best
- John DeGoes's Building a cutting Edge 3D engine in C++ .. has very good basic understanding


Coming to your question, ..since you know the aboslute position of the line in the world space, just specify these coordinates as the start and end points. Then draw a line primitive between these points. You do not have to do anything to worls transform here. Just set up your camera to be looking out the +ve Z axis.

You need world tranform when you , say, had your line in LOCAL coordinates ..

Share this post


Link to post
Share on other sites

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this