About Store Forum Documentation Contact



Post Reply 
drawing a simple line
Author Message
veksha Offline
Member

Post: #1
drawing a simple line
Hi, nice engine. loving it so far.

But I can't correctly draw a line under my character's feet. (3D)

This is my code. It works correctly while i'm at the center of the world,
but after I fly away from the center and starting to rotate my character(and camera)
I see that line is jumping to other places (or to other objects, e.g. trees).

Am I missing something?

Code:
Vec start = Players[0].pos() + Vec(0.0f,-2.5f,0.0f);
Vec end = start + Vec(0.0f,0.0f,1.0f) * Players[0].matrix().orn();
D.line(GREEN, start, end);

Video:
https://streamable.com/f9eh5b

apparently "SetMatrix();" helped. But I don't know what is it. Sorry, i'm still learning. wink
(This post was last modified: 08-28-2022 10:26 PM by veksha.)
08-28-2022 10:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: drawing a simple line
SetMatrix will set current drawing matrix (without parameter = identity)
08-29-2022 05:54 AM
Find all posts by this user Quote this message in a reply
Post Reply