Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Scaling of a Point Graph

Author
Message
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 10th May 2012 00:22


Basically I need to make a point graph that's scalable via mouse. I've got a sort of idea but just need a little advice on how it's done correctly.


Join or Support!
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 11th May 2012 22:00
Quote: "Basically I need to make a point graph that's scalable via mouse."

What do you want?

«It's the Shader, shader me this, shader me that»
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th May 2012 23:06
My best guess it will involve a lot of Cos and Sin

That is if you mean the line...

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 12th May 2012 01:39
Nope. It's exactly what I said. I need to scale a graph, nothing to do with lines on the graph.


Join or Support!
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 12th May 2012 02:03
Did you mean to scale graph in 3ds max?

«It's the Shader, shader me this, shader me that»
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th May 2012 06:33
Hmm...

How are you displaying the graph then?

You could use the mouse wheels z axis

zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 12th May 2012 07:21 Edited at: 12th May 2012 09:31
Try checking this out:


And here it is with data on it.:

Use the mouse wheel to zoom in and out. I didn't comment it or anything, but it should be fairly straight forward. Maybe you are looking for something like this?

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 12th May 2012 15:54
Quote: "You could use the mouse wheels z axis"


That's what I'm using

zeroSlave, probably should of said I've got to zoom closest to the mouse position relative to graph position. Graph is scalable/drag-able (easy part)

Also in your code, you could just make MZ a signed value to clean things up abit:
inc zoomFactor, ((MZ > 0) - (MZ < 0)) // turn end bit into function or something...

I can work out how to zoom, how to step with zooming and etc. But it's the drawing I'm stuck at. The graph scale is from 0.05 to 22,000,000 or something like that. So I'm going to need to step the LOD of the graph every 6-8 steps and add a zoomScalar that scales the factor greater the higher the factor is to increase the speed of zooming.

2D at centre scaling isn't as simple as it looks.


Join or Support!
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th May 2012 16:01
If you have one variable for your scale ie myScale#, then set it to 1.0. That way the default drawing can be set to that reference.

When the myScale# variable changes, whether up or down, then just simply multiply all offsets, positions, etc by that variable.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2026-07-08 01:56:37
Your offset time is: 2026-07-08 01:56:37