# Placing Object in World.

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

## 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 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 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 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 ..

1. 1
2. 2
3. 3
4. 4
Rutin
19
5. 5

• 14
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
632926
• Total Posts
3009252
• ### Who's Online (See full list)

There are no registered users currently online

×